linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [syzbot] [f2fs?] possible deadlock in f2fs_add_inline_entry
@ 2023-07-07  3:55 syzbot
  2023-08-24 15:55 ` syzbot
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: syzbot @ 2023-07-07  3:55 UTC (permalink / raw)
  To: chao, jaegeuk, linux-f2fs-devel, linux-fsdevel, linux-kernel,
	syzkaller-bugs

Hello,

syzbot found the following issue on:

HEAD commit:    296d53d8f84c Add linux-next specific files for 20230703
git tree:       linux-next
console+strace: https://syzkaller.appspot.com/x/log.txt?x=1742e724a80000
kernel config:  https://syzkaller.appspot.com/x/.config?x=5241eb40bbf2c7cf
dashboard link: https://syzkaller.appspot.com/bug?extid=a4976ce949df66b1ddf1
compiler:       gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=17030110a80000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=12a2f1f0a80000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/86f91798abf1/disk-296d53d8.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/80ef8a306265/vmlinux-296d53d8.xz
kernel image: https://storage.googleapis.com/syzbot-assets/d2faf52c9a84/bzImage-296d53d8.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/a912111147f7/mount_0.gz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+a4976ce949df66b1ddf1@syzkaller.appspotmail.com

F2FS-fs (loop0): Mounted with checkpoint version = 48b305e5
======================================================
WARNING: possible circular locking dependency detected
6.4.0-next-20230703-syzkaller #0 Not tainted
------------------------------------------------------
syz-executor218/5030 is trying to acquire lock:
ffff8880752cb160 (&fi->i_sem){+.+.}-{3:3}, at: f2fs_down_write fs/f2fs/f2fs.h:2133 [inline]
ffff8880752cb160 (&fi->i_sem){+.+.}-{3:3}, at: f2fs_add_inline_entry+0x2c4/0x6c0 fs/f2fs/inline.c:644

but task is already holding lock:
ffff8880752c9978 (&fi->i_xattr_sem){.+.+}-{3:3}, at: f2fs_down_read fs/f2fs/f2fs.h:2108 [inline]
ffff8880752c9978 (&fi->i_xattr_sem){.+.+}-{3:3}, at: f2fs_add_dentry+0x92/0x240 fs/f2fs/dir.c:783

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #1 (&fi->i_xattr_sem){.+.+}-{3:3}:
       down_read+0x9c/0x480 kernel/locking/rwsem.c:1520
       f2fs_down_read fs/f2fs/f2fs.h:2108 [inline]
       f2fs_getxattr+0xb96/0xfd0 fs/f2fs/xattr.c:532
       __f2fs_get_acl+0x59/0x610 fs/f2fs/acl.c:179
       f2fs_acl_create fs/f2fs/acl.c:377 [inline]
       f2fs_init_acl+0x152/0xb40 fs/f2fs/acl.c:420
       f2fs_init_inode_metadata+0x15d/0x1260 fs/f2fs/dir.c:558
       f2fs_add_regular_entry+0x776/0xb70 fs/f2fs/dir.c:740
       f2fs_add_dentry+0x1e1/0x240 fs/f2fs/dir.c:788
       f2fs_do_add_link+0x183/0x270 fs/f2fs/dir.c:827
       f2fs_add_link fs/f2fs/f2fs.h:3554 [inline]
       f2fs_mkdir+0x387/0x630 fs/f2fs/namei.c:781
       vfs_mkdir+0x242/0x460 fs/namei.c:4117
       do_mkdirat+0x28d/0x310 fs/namei.c:4140
       __do_sys_mkdir fs/namei.c:4160 [inline]
       __se_sys_mkdir fs/namei.c:4158 [inline]
       __x64_sys_mkdir+0xf6/0x140 fs/namei.c:4158
       do_syscall_x64 arch/x86/entry/common.c:50 [inline]
       do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80
       entry_SYSCALL_64_after_hwframe+0x63/0xcd

-> #0 (&fi->i_sem){+.+.}-{3:3}:
       check_prev_add kernel/locking/lockdep.c:3142 [inline]
       check_prevs_add kernel/locking/lockdep.c:3261 [inline]
       validate_chain kernel/locking/lockdep.c:3876 [inline]
       __lock_acquire+0x2e9d/0x5e20 kernel/locking/lockdep.c:5144
       lock_acquire kernel/locking/lockdep.c:5761 [inline]
       lock_acquire+0x1b1/0x520 kernel/locking/lockdep.c:5726
       down_write+0x92/0x200 kernel/locking/rwsem.c:1573
       f2fs_down_write fs/f2fs/f2fs.h:2133 [inline]
       f2fs_add_inline_entry+0x2c4/0x6c0 fs/f2fs/inline.c:644
       f2fs_add_dentry+0xa6/0x240 fs/f2fs/dir.c:784
       f2fs_do_add_link+0x183/0x270 fs/f2fs/dir.c:827
       f2fs_add_link fs/f2fs/f2fs.h:3554 [inline]
       f2fs_mkdir+0x387/0x630 fs/f2fs/namei.c:781
       vfs_mkdir+0x242/0x460 fs/namei.c:4117
       ovl_do_mkdir fs/overlayfs/overlayfs.h:196 [inline]
       ovl_mkdir_real+0xbc/0x390 fs/overlayfs/dir.c:146
       ovl_workdir_create+0x3d2/0x900 fs/overlayfs/super.c:309
       ovl_make_workdir fs/overlayfs/super.c:711 [inline]
       ovl_get_workdir fs/overlayfs/super.c:864 [inline]
       ovl_fill_super+0xcb6/0x5c90 fs/overlayfs/super.c:1400
       vfs_get_super+0xea/0x280 fs/super.c:1152
       vfs_get_tree+0x8d/0x350 fs/super.c:1519
       do_new_mount fs/namespace.c:3335 [inline]
       path_mount+0x136e/0x1e70 fs/namespace.c:3662
       do_mount fs/namespace.c:3675 [inline]
       __do_sys_mount fs/namespace.c:3884 [inline]
       __se_sys_mount fs/namespace.c:3861 [inline]
       __x64_sys_mount+0x283/0x300 fs/namespace.c:3861
       do_syscall_x64 arch/x86/entry/common.c:50 [inline]
       do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80
       entry_SYSCALL_64_after_hwframe+0x63/0xcd

other info that might help us debug this:

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  rlock(&fi->i_xattr_sem);
                               lock(&fi->i_sem);
                               lock(&fi->i_xattr_sem);
  lock(&fi->i_sem);

 *** DEADLOCK ***

5 locks held by syz-executor218/5030:
 #0: ffff8880780d60e0 (&type->s_umount_key#42/1){+.+.}-{3:3}, at: alloc_super+0x22e/0xb40 fs/super.c:228
 #1: ffff8880271d6410 (sb_writers#9){.+.+}-{0:0}, at: ovl_make_workdir fs/overlayfs/super.c:707 [inline]
 #1: ffff8880271d6410 (sb_writers#9){.+.+}-{0:0}, at: ovl_get_workdir fs/overlayfs/super.c:864 [inline]
 #1: ffff8880271d6410 (sb_writers#9){.+.+}-{0:0}, at: ovl_fill_super+0xc8d/0x5c90 fs/overlayfs/super.c:1400
 #2: ffff8880752c9300 (&type->i_mutex_dir_key#6/1){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:806 [inline]
 #2: ffff8880752c9300 (&type->i_mutex_dir_key#6/1){+.+.}-{3:3}, at: ovl_workdir_create+0x137/0x900 fs/overlayfs/super.c:281
 #3: ffff8880786603b0 (&sbi->cp_rwsem){.+.+}-{3:3}, at: f2fs_down_read fs/f2fs/f2fs.h:2108 [inline]
 #3: ffff8880786603b0 (&sbi->cp_rwsem){.+.+}-{3:3}, at: f2fs_lock_op fs/f2fs/f2fs.h:2151 [inline]
 #3: ffff8880786603b0 (&sbi->cp_rwsem){.+.+}-{3:3}, at: f2fs_mkdir+0x2a2/0x630 fs/f2fs/namei.c:780
 #4: ffff8880752c9978 (&fi->i_xattr_sem){.+.+}-{3:3}, at: f2fs_down_read fs/f2fs/f2fs.h:2108 [inline]
 #4: ffff8880752c9978 (&fi->i_xattr_sem){.+.+}-{3:3}, at: f2fs_add_dentry+0x92/0x240 fs/f2fs/dir.c:783

stack backtrace:
CPU: 0 PID: 5030 Comm: syz-executor218 Not tainted 6.4.0-next-20230703-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/27/2023
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0xd9/0x150 lib/dump_stack.c:106
 check_noncircular+0x2df/0x3b0 kernel/locking/lockdep.c:2195
 check_prev_add kernel/locking/lockdep.c:3142 [inline]
 check_prevs_add kernel/locking/lockdep.c:3261 [inline]
 validate_chain kernel/locking/lockdep.c:3876 [inline]
 __lock_acquire+0x2e9d/0x5e20 kernel/locking/lockdep.c:5144
 lock_acquire kernel/locking/lockdep.c:5761 [inline]
 lock_acquire+0x1b1/0x520 kernel/locking/lockdep.c:5726
 down_write+0x92/0x200 kernel/locking/rwsem.c:1573
 f2fs_down_write fs/f2fs/f2fs.h:2133 [inline]
 f2fs_add_inline_entry+0x2c4/0x6c0 fs/f2fs/inline.c:644
 f2fs_add_dentry+0xa6/0x240 fs/f2fs/dir.c:784
 f2fs_do_add_link+0x183/0x270 fs/f2fs/dir.c:827
 f2fs_add_link fs/f2fs/f2fs.h:3554 [inline]
 f2fs_mkdir+0x387/0x630 fs/f2fs/namei.c:781
 vfs_mkdir+0x242/0x460 fs/namei.c:4117
 ovl_do_mkdir fs/overlayfs/overlayfs.h:196 [inline]
 ovl_mkdir_real+0xbc/0x390 fs/overlayfs/dir.c:146
 ovl_workdir_create+0x3d2/0x900 fs/overlayfs/super.c:309
 ovl_make_workdir fs/overlayfs/super.c:711 [inline]
 ovl_get_workdir fs/overlayfs/super.c:864 [inline]
 ovl_fill_super+0xcb6/0x5c90 fs/overlayfs/super.c:1400
 vfs_get_super+0xea/0x280 fs/super.c:1152
 vfs_get_tree+0x8d/0x350 fs/super.c:1519
 do_new_mount fs/namespace.c:3335 [inline]
 path_mount+0x136e/0x1e70 fs/namespace.c:3662
 do_mount fs/namespace.c:3675 [inline]
 __do_sys_mount fs/namespace.c:3884 [inline]
 __se_sys_mount fs/namespace.c:3861 [inline]
 __x64_sys_mount+0x283/0x300 fs/namespace.c:3861
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f0b7b784909
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 51 14 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 c0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffcdf3d7158 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 0030656c69662f2e RCX: 00007f0b7b784909
RDX: 0000000020000280 RSI: 0000000020000040 RDI: 0000000000000000
RBP: 00007f0b7b7441a0 R08: 0000000020000180 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007f0b7b744230
R13: 0000000


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkaller@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the bug is already fixed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.

If you want to change bug's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the bug is a duplicate of another bug, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [syzbot] [f2fs?] possible deadlock in f2fs_add_inline_entry
  2023-07-07  3:55 [syzbot] [f2fs?] possible deadlock in f2fs_add_inline_entry syzbot
@ 2023-08-24 15:55 ` syzbot
  2023-08-25  1:08   ` Chao Yu
  2023-08-25  5:37 ` [PATCH] f2fs: fix deadlock in f2f2_add_dentry Lizhi Xu
  2023-10-26  6:59 ` [syzbot] [f2fs?] possible deadlock in f2fs_add_inline_entry syzbot
  2 siblings, 1 reply; 8+ messages in thread
From: syzbot @ 2023-08-24 15:55 UTC (permalink / raw)
  To: chao, hdanton, jaegeuk, linux-f2fs-devel, linux-fsdevel,
	linux-kernel, syzkaller-bugs

syzbot has bisected this issue to:

commit 5eda1ad1aaffdfebdecf7a164e586060a210f74f
Author: Jaegeuk Kim <jaegeuk@kernel.org>
Date:   Wed Jun 28 08:00:56 2023 +0000

    f2fs: fix deadlock in i_xattr_sem and inode page lock

bisection log:  https://syzkaller.appspot.com/x/bisect.txt?x=167691b7a80000
start commit:   cacc6e22932f tpm: Add a helper for checking hwrng enabled
git tree:       upstream
final oops:     https://syzkaller.appspot.com/x/report.txt?x=157691b7a80000
console output: https://syzkaller.appspot.com/x/log.txt?x=117691b7a80000
kernel config:  https://syzkaller.appspot.com/x/.config?x=171b698bc2e613cf
dashboard link: https://syzkaller.appspot.com/bug?extid=a4976ce949df66b1ddf1
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=103c6bb3a80000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=17bb51c7a80000

Reported-by: syzbot+a4976ce949df66b1ddf1@syzkaller.appspotmail.com
Fixes: 5eda1ad1aaff ("f2fs: fix deadlock in i_xattr_sem and inode page lock")

For information about bisection process see: https://goo.gl/tpsmEJ#bisection

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [syzbot] [f2fs?] possible deadlock in f2fs_add_inline_entry
  2023-08-24 15:55 ` syzbot
@ 2023-08-25  1:08   ` Chao Yu
  2023-08-25  1:47     ` syzbot
  0 siblings, 1 reply; 8+ messages in thread
From: Chao Yu @ 2023-08-25  1:08 UTC (permalink / raw)
  To: syzbot, hdanton, jaegeuk, linux-f2fs-devel, linux-fsdevel,
	linux-kernel, syzkaller-bugs

On 2023/8/24 23:55, syzbot wrote:
> syzbot has bisected this issue to:
> 
> commit 5eda1ad1aaffdfebdecf7a164e586060a210f74f
> Author: Jaegeuk Kim <jaegeuk@kernel.org>
> Date:   Wed Jun 28 08:00:56 2023 +0000
> 
>      f2fs: fix deadlock in i_xattr_sem and inode page lock
> 
> bisection log:  https://syzkaller.appspot.com/x/bisect.txt?x=167691b7a80000
> start commit:   cacc6e22932f tpm: Add a helper for checking hwrng enabled
> git tree:       upstream
> final oops:     https://syzkaller.appspot.com/x/report.txt?x=157691b7a80000
> console output: https://syzkaller.appspot.com/x/log.txt?x=117691b7a80000
> kernel config:  https://syzkaller.appspot.com/x/.config?x=171b698bc2e613cf
> dashboard link: https://syzkaller.appspot.com/bug?extid=a4976ce949df66b1ddf1
> syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=103c6bb3a80000
> C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=17bb51c7a80000
> 
> Reported-by: syzbot+a4976ce949df66b1ddf1@syzkaller.appspotmail.com
> Fixes: 5eda1ad1aaff ("f2fs: fix deadlock in i_xattr_sem and inode page lock")

#syz test: https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git dev

> 
> For information about bisection process see: https://goo.gl/tpsmEJ#bisection

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [syzbot] [f2fs?] possible deadlock in f2fs_add_inline_entry
  2023-08-25  1:08   ` Chao Yu
@ 2023-08-25  1:47     ` syzbot
  0 siblings, 0 replies; 8+ messages in thread
From: syzbot @ 2023-08-25  1:47 UTC (permalink / raw)
  To: chao, hdanton, jaegeuk, linux-f2fs-devel, linux-fsdevel,
	linux-kernel, syzkaller-bugs

Hello,

syzbot has tested the proposed patch and the reproducer did not trigger any issue:

Reported-and-tested-by: syzbot+a4976ce949df66b1ddf1@syzkaller.appspotmail.com

Tested on:

commit:         5c13e238 f2fs: avoid false alarm of circular locking
git tree:       https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git dev
console output: https://syzkaller.appspot.com/x/log.txt?x=121bdfcfa80000
kernel config:  https://syzkaller.appspot.com/x/.config?x=5ff9844b1e911216
dashboard link: https://syzkaller.appspot.com/bug?extid=a4976ce949df66b1ddf1
compiler:       gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40

Note: no patches were applied.
Note: testing is done by a robot and is best-effort only.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH] f2fs: fix deadlock in f2f2_add_dentry
  2023-07-07  3:55 [syzbot] [f2fs?] possible deadlock in f2fs_add_inline_entry syzbot
  2023-08-24 15:55 ` syzbot
@ 2023-08-25  5:37 ` Lizhi Xu
  2023-09-06 12:56   ` Tetsuo Handa
  2023-10-26  6:59 ` [syzbot] [f2fs?] possible deadlock in f2fs_add_inline_entry syzbot
  2 siblings, 1 reply; 8+ messages in thread
From: Lizhi Xu @ 2023-08-25  5:37 UTC (permalink / raw)
  To: syzbot+a4976ce949df66b1ddf1
  Cc: chao, jaegeuk, linux-f2fs-devel, linux-fsdevel, linux-kernel,
	syzkaller-bugs

There are two paths:
1. f2fs_add_dentry->f2fs_down_read->f2fs_add_inline_entry->down_write->
   up_write->f2fs_up_read
2. f2fs_add_dentry->f2fs_add_regular_entry->down_write->
   f2fs_init_inode_metadata->f2fs_down_read->f2fs_up_read->up_write

Force order lock to read->write.

Signed-off-by: Lizhi Xu <lizhi.xu@windriver.com>
Reported-and-tested-by: syzbot+a4976ce949df66b1ddf1@syzkaller.appspotmail.com
---
 fs/f2fs/dir.c    | 4 +---
 fs/f2fs/inline.c | 2 ++
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/f2fs/dir.c b/fs/f2fs/dir.c
index d635c58cf5a3..022dc02c1390 100644
--- a/fs/f2fs/dir.c
+++ b/fs/f2fs/dir.c
@@ -736,12 +736,12 @@ int f2fs_add_regular_entry(struct inode *dir, const struct f2fs_filename *fname,
 	f2fs_wait_on_page_writeback(dentry_page, DATA, true, true);
 
 	if (inode) {
-		f2fs_down_write(&F2FS_I(inode)->i_sem);
 		page = f2fs_init_inode_metadata(inode, dir, fname, NULL);
 		if (IS_ERR(page)) {
 			err = PTR_ERR(page);
 			goto fail;
 		}
+		f2fs_down_write(&F2FS_I(inode)->i_sem);
 	}
 
 	make_dentry_ptr_block(NULL, &d, dentry_blk);
@@ -780,9 +780,7 @@ int f2fs_add_dentry(struct inode *dir, const struct f2fs_filename *fname,
 		 * Should get i_xattr_sem to keep the lock order:
 		 * i_xattr_sem -> inode_page lock used by f2fs_setxattr.
 		 */
-		f2fs_down_read(&F2FS_I(dir)->i_xattr_sem);
 		err = f2fs_add_inline_entry(dir, fname, inode, ino, mode);
-		f2fs_up_read(&F2FS_I(dir)->i_xattr_sem);
 	}
 	if (err == -EAGAIN)
 		err = f2fs_add_regular_entry(dir, fname, inode, ino, mode);
diff --git a/fs/f2fs/inline.c b/fs/f2fs/inline.c
index 4638fee16a91..7618b383c2b7 100644
--- a/fs/f2fs/inline.c
+++ b/fs/f2fs/inline.c
@@ -628,10 +628,12 @@ int f2fs_add_inline_entry(struct inode *dir, const struct f2fs_filename *fname,
 	if (IS_ERR(ipage))
 		return PTR_ERR(ipage);
 
+	f2fs_down_read(&F2FS_I(dir)->i_xattr_sem);
 	inline_dentry = inline_data_addr(dir, ipage);
 	make_dentry_ptr_inline(dir, &d, inline_dentry);
 
 	bit_pos = f2fs_room_for_filename(d.bitmap, slots, d.max);
+	f2fs_up_read(&F2FS_I(dir)->i_xattr_sem);
 	if (bit_pos >= d.max) {
 		err = do_convert_inline_dir(dir, ipage, inline_dentry);
 		if (err)
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] f2fs: fix deadlock in f2f2_add_dentry
  2023-08-25  5:37 ` [PATCH] f2fs: fix deadlock in f2f2_add_dentry Lizhi Xu
@ 2023-09-06 12:56   ` Tetsuo Handa
  0 siblings, 0 replies; 8+ messages in thread
From: Tetsuo Handa @ 2023-09-06 12:56 UTC (permalink / raw)
  To: Lizhi Xu, syzbot+a4976ce949df66b1ddf1
  Cc: chao, jaegeuk, linux-f2fs-devel, linux-fsdevel, linux-kernel,
	syzkaller-bugs

On 2023/08/25 14:37, Lizhi Xu wrote:
> @@ -736,12 +736,12 @@ int f2fs_add_regular_entry(struct inode *dir, const struct f2fs_filename *fname,
>  	f2fs_wait_on_page_writeback(dentry_page, DATA, true, true);
>  
>  	if (inode) {
> -		f2fs_down_write(&F2FS_I(inode)->i_sem);
>  		page = f2fs_init_inode_metadata(inode, dir, fname, NULL);
>  		if (IS_ERR(page)) {
>  			err = PTR_ERR(page);
>  			goto fail;
>  		}
> +		f2fs_down_write(&F2FS_I(inode)->i_sem);
>  	}

Above change does not match below.

fail:
	if (inode)
		f2fs_up_write(&F2FS_I(inode)->i_sem);

>  
>  	make_dentry_ptr_block(NULL, &d, dentry_blk);


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [syzbot] [f2fs?] possible deadlock in f2fs_add_inline_entry
  2023-07-07  3:55 [syzbot] [f2fs?] possible deadlock in f2fs_add_inline_entry syzbot
  2023-08-24 15:55 ` syzbot
  2023-08-25  5:37 ` [PATCH] f2fs: fix deadlock in f2f2_add_dentry Lizhi Xu
@ 2023-10-26  6:59 ` syzbot
  2023-10-26  9:21   ` Aleksandr Nogikh
  2 siblings, 1 reply; 8+ messages in thread
From: syzbot @ 2023-10-26  6:59 UTC (permalink / raw)
  To: arthurgrillo, chao, hdanton, jaegeuk, linux-f2fs-devel,
	linux-fsdevel, linux-kernel, lizhi.xu, mairacanal, mcanal,
	penguin-kernel, syzkaller-bugs

syzbot suspects this issue was fixed by commit:

commit a0e6a017ab56936c0405fe914a793b241ed25ee0
Author: Maíra Canal <mcanal@igalia.com>
Date:   Tue May 23 12:32:08 2023 +0000

    drm/vkms: Fix race-condition between the hrtimer and the atomic commit

bisection log:  https://syzkaller.appspot.com/x/bisect.txt?x=166c090d680000
start commit:   28f20a19294d Merge tag 'x86-urgent-2023-08-26' of git://gi..
git tree:       upstream
kernel config:  https://syzkaller.appspot.com/x/.config?x=21a578092dd61d05
dashboard link: https://syzkaller.appspot.com/bug?extid=a4976ce949df66b1ddf1
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=15a09340680000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=118909eba80000

If the result looks correct, please mark the issue as fixed by replying with:

#syz fix: drm/vkms: Fix race-condition between the hrtimer and the atomic commit

For information about bisection process see: https://goo.gl/tpsmEJ#bisection

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [syzbot] [f2fs?] possible deadlock in f2fs_add_inline_entry
  2023-10-26  6:59 ` [syzbot] [f2fs?] possible deadlock in f2fs_add_inline_entry syzbot
@ 2023-10-26  9:21   ` Aleksandr Nogikh
  0 siblings, 0 replies; 8+ messages in thread
From: Aleksandr Nogikh @ 2023-10-26  9:21 UTC (permalink / raw)
  To: syzbot
  Cc: arthurgrillo, chao, hdanton, jaegeuk, linux-f2fs-devel,
	linux-fsdevel, linux-kernel, lizhi.xu, mairacanal, mcanal,
	penguin-kernel, syzkaller-bugs

For some still unknown reason, syzbot's bisections of fs bugs
sometimes end up in drm. There've been quite a few such cases
already..

Please ignore this bot's message.


On Thu, Oct 26, 2023 at 8:59 AM syzbot
<syzbot+a4976ce949df66b1ddf1@syzkaller.appspotmail.com> wrote:
>
> syzbot suspects this issue was fixed by commit:
>
> commit a0e6a017ab56936c0405fe914a793b241ed25ee0
> Author: Maíra Canal <mcanal@igalia.com>
> Date:   Tue May 23 12:32:08 2023 +0000
>
>     drm/vkms: Fix race-condition between the hrtimer and the atomic commit
>
> bisection log:  https://syzkaller.appspot.com/x/bisect.txt?x=166c090d680000
> start commit:   28f20a19294d Merge tag 'x86-urgent-2023-08-26' of git://gi..
> git tree:       upstream
> kernel config:  https://syzkaller.appspot.com/x/.config?x=21a578092dd61d05
> dashboard link: https://syzkaller.appspot.com/bug?extid=a4976ce949df66b1ddf1
> syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=15a09340680000
> C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=118909eba80000
>
> If the result looks correct, please mark the issue as fixed by replying with:
>
> #syz fix: drm/vkms: Fix race-condition between the hrtimer and the atomic commit
>
> For information about bisection process see: https://goo.gl/tpsmEJ#bisection
>
> --
> You received this message because you are subscribed to the Google Groups "syzkaller-bugs" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to syzkaller-bugs+unsubscribe@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/syzkaller-bugs/00000000000017dd680608991d75%40google.com.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-10-26  9:21 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-07  3:55 [syzbot] [f2fs?] possible deadlock in f2fs_add_inline_entry syzbot
2023-08-24 15:55 ` syzbot
2023-08-25  1:08   ` Chao Yu
2023-08-25  1:47     ` syzbot
2023-08-25  5:37 ` [PATCH] f2fs: fix deadlock in f2f2_add_dentry Lizhi Xu
2023-09-06 12:56   ` Tetsuo Handa
2023-10-26  6:59 ` [syzbot] [f2fs?] possible deadlock in f2fs_add_inline_entry syzbot
2023-10-26  9:21   ` Aleksandr Nogikh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).