1 # This is a BitKeeper generated patch for the following project:
2 # Project Name: Linux kernel tree
4 # namei.c | 21 ++++++++++++++++++++-
5 # 1 files changed, 20 insertions(+), 1 deletion(-)
7 # The following is the BitKeeper ChangeSet Log
8 # --------------------------------------------
9 # 02/11/07 tytso@snap.thunk.org 1.779
10 # Fix ext3 htree rename bug.
12 # This fixes an ext3 htree bug pointed out by Christopher Li; if
13 # adding the new name to the directory causes a split, this can cause
14 # the directory entry containing the old name to move to another
15 # block, and then the removal of the old name will fail.
16 # --------------------------------------------
18 diff -Nru a/fs/ext3/namei.c b/fs/ext3/namei.c
19 --- a/fs/ext3/namei.c Thu Nov 7 10:57:49 2002
20 +++ b/fs/ext3/namei.c Thu Nov 7 10:57:49 2002
21 @@ -2173,7 +2173,26 @@
25 - ext3_delete_entry(handle, old_dir, old_de, old_bh);
26 + retval = ext3_delete_entry(handle, old_dir, old_de, old_bh);
27 + if (retval == -ENOENT) {
29 + * old_de could have moved out from under us.
31 + struct buffer_head *old_bh2;
32 + struct ext3_dir_entry_2 *old_de2;
34 + old_bh2 = ext3_find_entry(old_dentry, &old_de2);
36 + retval = ext3_delete_entry(handle, old_dir,
42 + ext3_warning(old_dir->i_sb, "ext3_rename",
43 + "Deleting old file (%lu), %d, error=%d",
44 + old_dir->i_ino, old_dir->i_nlink, retval);