From 8cccbf9b22f590b518f8d0441aef7219522788fa Mon Sep 17 00:00:00 2001 From: Andreas Dilger Date: Wed, 26 Oct 2011 03:22:31 -0400 Subject: [PATCH] --- yaml --- r: 273153 b: refs/heads/master c: 909a4cf1ffe4b875c87abf38239a9bfd25167e0c h: refs/heads/master i: 273151: 0c2669f67742e981f13947241fe644836c0d4f74 v: v3 --- [refs] | 2 +- trunk/fs/ext4/namei.c | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 03474f9e4556..3270f6e893a6 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: cf8039036a6e9c5f7144841925f212a957faf1aa +refs/heads/master: 909a4cf1ffe4b875c87abf38239a9bfd25167e0c diff --git a/trunk/fs/ext4/namei.c b/trunk/fs/ext4/namei.c index a067835bbac1..4a550aa07614 100644 --- a/trunk/fs/ext4/namei.c +++ b/trunk/fs/ext4/namei.c @@ -1706,9 +1706,8 @@ static void ext4_inc_count(handle_t *handle, struct inode *inode) */ 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); }