]> git.itanic.dy.fi Git - linux-stable/commit
f2fs: initialize locks earlier in f2fs_fill_super()
authorTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Tue, 8 Nov 2022 22:04:42 +0000 (07:04 +0900)
committerJaegeuk Kim <jaegeuk@kernel.org>
Fri, 11 Nov 2022 17:48:24 +0000 (09:48 -0800)
commit92b4cf5b48955a4bdd15fe4e2067db8ebd87f04c
treeda1e1fecfad9f7eec859c0e9e0f3bc2b159c1d69
parent59237a21776f70ffb0420611c23e7158e1317037
f2fs: initialize locks earlier in f2fs_fill_super()

syzbot is reporting lockdep warning at f2fs_handle_error() [1], for
spin_lock(&sbi->error_lock) is called before spin_lock_init() is called.
For safe locking in error handling, move initialization of locks (and
obvious structures) in f2fs_fill_super() to immediately after memory
allocation.

Link: https://syzkaller.appspot.com/bug?extid=40642be9b7e0bb28e0df
Reported-by: syzbot <syzbot+40642be9b7e0bb28e0df@syzkaller.appspotmail.com>
Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Tested-by: syzbot <syzbot+40642be9b7e0bb28e0df@syzkaller.appspotmail.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/super.c