summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2023-03-19 09:38:26 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2023-03-19 09:38:26 -0700
commit995bba436bc5c6a200510828a09cd404a7f2a129 (patch)
tree4802bb3b37bf81862f6a97d5650e6ef6bc1434da /fs
parenta3671bd86a9770e34969522d29bb30a1b66fd88a (diff)
parent70e42feab2e20618ddd0cbfc4ab4b08628236ecd (diff)
Merge tag 'ext4_for_linus_urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4
Pull ext4 fix from Ted Ts'o: "Fix a double unlock bug on an error path in ext4, found by smatch and syzkaller" * tag 'ext4_for_linus_urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: ext4: fix possible double unlock when moving a directory
Diffstat (limited to 'fs')
-rw-r--r--fs/ext4/namei.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index 31e21de56432..a5010b5b8a8c 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -3884,10 +3884,8 @@ static int ext4_rename(struct mnt_idmap *idmap, struct inode *old_dir,
goto end_rename;
}
retval = ext4_rename_dir_prepare(handle, &old);
- if (retval) {
- inode_unlock(old.inode);
+ if (retval)
goto end_rename;
- }
}
/*
* If we're renaming a file within an inline_data dir and adding or