aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/ext4/namei.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index a067835bbac1..4a550aa07614 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -1706,9 +1706,8 @@ static void ext4_inc_count(handle_t *handle, struct inode *inode)
1706 */ 1706 */
1707static void ext4_dec_count(handle_t *handle, struct inode *inode) 1707static void ext4_dec_count(handle_t *handle, struct inode *inode)
1708{ 1708{
1709 drop_nlink(inode); 1709 if (!S_ISDIR(inode->i_mode) || inode->i_nlink > 2)
1710 if (S_ISDIR(inode->i_mode) && inode->i_nlink == 0) 1710 drop_nlink(inode);
1711 inc_nlink(inode);
1712} 1711}
1713 1712
1714 1713