From c41e1eb192a5a5b38ee46293850e9d7c7d970791 Mon Sep 17 00:00:00 2001 From: adilger Date: Thu, 27 May 2004 08:15:51 +0000 Subject: [PATCH] Fix rename bug for this patch series, whose name sadly doesn't match "*htree*". b=3417 --- lustre/kernel_patches/patches/ext-2.4-patch-4.patch | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/lustre/kernel_patches/patches/ext-2.4-patch-4.patch b/lustre/kernel_patches/patches/ext-2.4-patch-4.patch index 67f5afa..4c8d4fa 100644 --- a/lustre/kernel_patches/patches/ext-2.4-patch-4.patch +++ b/lustre/kernel_patches/patches/ext-2.4-patch-4.patch @@ -18,19 +18,23 @@ diff -Nru a/fs/ext3/namei.c b/fs/ext3/namei.c --- a/fs/ext3/namei.c Thu Nov 7 10:57:49 2002 +++ b/fs/ext3/namei.c Thu Nov 7 10:57:49 2002 -@@ -2173,7 +2173,26 @@ +@@ -2173,7 +2173,30 @@ /* * ok, that's it */ - ext3_delete_entry(handle, old_dir, old_de, old_bh); -+ retval = ext3_delete_entry(handle, old_dir, old_de, old_bh); -+ if (retval == -ENOENT) { -+ /* -+ * old_de could have moved out from under us. -+ */ ++ if (le32_to_cpu(old_de->inode) != old_inode->i_ino || ++ old_de->name_len != old_dentry->d_name.len || ++ strncmp(old_de->name, old_dentry->d_name.name, old_de->name_len) || ++ (retval = ext3_delete_entry(handle, old_dir, ++ old_de, old_bh)) == -ENOENT) { ++ /* old_de could have moved from under us during htree split, so ++ * make sure that we are deleting the right entry. We might ++ * also be pointing to a stale entry in the unused part of ++ * old_bh so just checking inum and the name isn't enough. */ + struct buffer_head *old_bh2; + struct ext3_dir_entry_2 *old_de2; -+ ++ + old_bh2 = ext3_find_entry(old_dentry, &old_de2); + if (old_bh2) { + retval = ext3_delete_entry(handle, old_dir, -- 1.8.3.1