Whamcloud - gitweb
- missed patches from suse-2.4.21-2 series added
[fs/lustre-release.git] / lustre / kernel_patches / patches / ext3-htree-rename_fix.patch
1 ===== fs/ext3/namei.c 1.52 vs edited =====
2 --- 1.52/fs/ext3/namei.c        Mon May 10 05:25:34 2004
3 +++ edited/fs/ext3/namei.c      Thu May 20 19:57:10 2004
4 @@ -2264,11 +2264,15 @@
5         /*
6          * ok, that's it
7          */
8 -       retval = ext3_delete_entry(handle, old_dir, old_de, old_bh);
9 -       if (retval == -ENOENT) {
10 -               /*
11 -                * old_de could have moved out from under us.
12 -                */
13 +       if (le32_to_cpu(old_de->inode) != old_inode->i_ino ||
14 +           old_de->name_len != old_dentry->d_name.len ||
15 +           strncmp(old_de->name, old_dentry->d_name.name, old_de->name_len) ||
16 +           (retval = ext3_delete_entry(handle, old_dir,
17 +                                       old_de, old_bh)) == -ENOENT) {
18 +               /* old_de could have moved from under us during htree split, so
19 +                * make sure that we are deleting the right entry.  We might
20 +                * also be pointing to a stale entry in the unused part of
21 +                * old_bh so just checking inum and the name isn't enough. */
22                 struct buffer_head *old_bh2;
23                 struct ext3_dir_entry_2 *old_de2;
24