Skip to content

Commit

Permalink
ext4: fix possible double unlock when moving a directory
Browse files Browse the repository at this point in the history
Fixes: 0813299 ("ext4: Fix possible corruption when moving a directory")
Link: https://lore.kernel.org/r/5efbe1b9-ad8b-4a4f-b422-24824d2b775c@kili.mountain
Reported-by: Dan Carpenter <error27@gmail.com>
Reported-by: syzbot+0c73d1d8b952c5f3d714@syzkaller.appspotmail.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
  • Loading branch information
Theodore Ts'o committed Mar 18, 2023
1 parent eeac8ed commit 70e42fe
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions fs/ext4/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 70e42fe

Please sign in to comment.