diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ext4/namei.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c index a067835..4a550aa 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) */ 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); } |