When landing the nlink patch for ext4, for an unknown reason the
logic in ext4_dec_count() was changed from the ext3 version of
the patch. It now drops the nlink = 0 temporarily and then
if it is a directory with nlink == 0 it increases nlink again.
Instead, only drop nlink if it is larger than 2.
Change-Id: Ieeff3e45daea56f502848f9c2b0fb04f0a9d2b6d
Author: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Yang Sheng <ys@whamcloud.com>
Reviewed-on: http://review.whamcloud.com/1644
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
--- /dev/null
+Index: linux-stage/fs/ext4/namei.c
+===================================================================
+--- linux-stage.orig/fs/ext4/namei.c
++++ linux-stage/fs/ext4/namei.c
+@@ -1709,9 +1709,8 @@ static void ext4_inc_count(handle_t *han
+ */
+ static void ext4_dec_count(handle_t *handle, struct inode *inode)
+ {
+- drop_nlink(inode);
+- if (S_ISDIR(inode->i_mode) && inode->i_nlink == 0)
+- inc_nlink(inode);
++ if (!S_ISDIR(inode->i_mode) || inode->i_nlink > 2)
++ drop_nlink(inode);
+ }
ext4-map_inode_page-2.6.18-rhel5.patch
export-ext4-2.6-rhel5.patch
ext4-remove-cond_resched-calls-rhel5.patch
+ext4-nlink-2.6-rhel5.patch
ext4-inode-version-rhel5.patch
ext4-mmp-rhel5.patch
ext4-lookup-dotdot-rhel5.patch
ext4-map_inode_page-2.6.18-rhel5.patch
export-ext4-2.6-rhel5.patch
ext4-remove-cond_resched-calls-rhel5.patch
+ext4-nlink-2.6-rhel5.patch
ext4-ext_generation-sles11.patch
ext4-inode-version-rhel6.patch
ext4-mmp-rhel6.patch