linux/fs/ext4
Jan Kara 2ef7f82921 ext4: Fix deadlock during directory rename
[ Upstream commit 3c92792da8 ]

As lockdep properly warns, we should not be locking i_rwsem while having
transactions started as the proper lock ordering used by all directory
handling operations is i_rwsem -> transaction start. Fix the lock
ordering by moving the locking of the directory earlier in
ext4_rename().

Reported-by: syzbot+9d16c39efb5fade84574@syzkaller.appspotmail.com
Fixes: 0813299c58 ("ext4: Fix possible corruption when moving a directory")
Link: https://syzkaller.appspot.com/bug?extid=9d16c39efb5fade84574
Signed-off-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20230301141004.15087-1-jack@suse.cz
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-03-17 08:50:29 +01:00
..
.kunitconfig
acl.c
acl.h
balloc.c
bitmap.c
block_validity.c
crypto.c
dir.c
ext4_extents.h
ext4_jbd2.c
ext4_jbd2.h
ext4.h ext4: fix incorrect options show of original mount_opt and extend mount_opt2 2023-03-11 13:55:27 +01:00
extents_status.c ext4: fix reserved cluster accounting in __es_remove_extent() 2023-01-07 11:11:59 +01:00
extents_status.h
extents.c ext4: fix delayed allocation bug in ext4_clu_mapped for bigalloc + inline 2023-01-07 11:12:01 +01:00
fast_commit.c ext4: use ext4_fc_tl_mem in fast-commit replay path 2023-03-11 13:55:22 +01:00
fast_commit.h ext4: add missing validation of fast-commit record lengths 2023-01-07 11:12:00 +01:00
file.c
fsmap.c ext4: fix another off-by-one fsmap error on 1k block filesystems 2023-03-17 08:50:16 +01:00
fsmap.h
fsync.c
hash.c
ialloc.c
indirect.c ext4: fix error code return to user-space in ext4_get_branch() 2023-01-07 11:12:01 +01:00
inline.c ext4: move where set the MAY_INLINE_DATA flag is set 2023-03-17 08:50:16 +01:00
inode-test.c
inode.c ext4: move where set the MAY_INLINE_DATA flag is set 2023-03-17 08:50:16 +01:00
ioctl.c ext4: zero i_disksize when initializing the bootloader inode 2023-03-17 08:50:16 +01:00
Kconfig
Makefile
mballoc.c
mballoc.h
migrate.c
mmp.c
move_extent.c
namei.c ext4: Fix deadlock during directory rename 2023-03-17 08:50:29 +01:00
orphan.c ext4: remove trailing newline from ext4_msg() message 2023-01-07 11:11:58 +01:00
page-io.c ext4: fix cgroup writeback accounting with fs-layer encryption 2023-03-17 08:50:16 +01:00
readpage.c
resize.c ext4: fix corrupt backup group descriptors after online resize 2023-01-07 11:12:01 +01:00
super.c ext4: fix incorrect options show of original mount_opt and extend mount_opt2 2023-03-11 13:55:27 +01:00
symlink.c
sysfs.c ext4: Fix function prototype mismatch for ext4_feat_ktype 2023-02-25 11:25:43 +01:00
truncate.h
verity.c fs: ext4: initialize fsdata in pagecache_write() 2023-01-07 11:11:58 +01:00
xattr_hurd.c
xattr_security.c
xattr_trusted.c
xattr_user.c
xattr.c ext4: fix WARNING in ext4_update_inline_data 2023-03-17 08:50:16 +01:00
xattr.h