Re: [syzbot] [ext4?] WARNING: bad unlock balance in ext4_rename2

From: Eric Biggers
Date: Tue Mar 07 2023 - 14:34:21 EST


On Mon, Mar 06, 2023 at 03:34:40AM -0800, syzbot wrote:
> =====================================
> WARNING: bad unlock balance detected!
> 6.2.0-syzkaller-13467-g0988a0ea7919 #0 Not tainted
> -------------------------------------
> syz-executor.3/8027 is trying to release lock (&type->i_mutex_dir_key) at:
> [<ffffffff82448753>] inode_unlock include/linux/fs.h:763 [inline]
> [<ffffffff82448753>] ext4_rename fs/ext4/namei.c:4017 [inline]
> [<ffffffff82448753>] ext4_rename2+0x3d03/0x4410 fs/ext4/namei.c:4193
> but there are no more locks to release!

I think this is the same as
"[bug report] ext4: Fix possible corruption when moving a directory"
(https://lore.kernel.org/linux-ext4/5efbe1b9-ad8b-4a4f-b422-24824d2b775c@kili.mountain).
See there for the root cause (double unlock).

- Eric