aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/tree-log.c')
-rw-r--r--fs/btrfs/tree-log.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
index b6818eed0bd5..744a69b2eb0f 100644
--- a/fs/btrfs/tree-log.c
+++ b/fs/btrfs/tree-log.c
@@ -1384,7 +1384,10 @@ static noinline int link_to_fixup_dir(struct btrfs_trans_handle *trans,
1384 1384
1385 btrfs_release_path(path); 1385 btrfs_release_path(path);
1386 if (ret == 0) { 1386 if (ret == 0) {
1387 btrfs_inc_nlink(inode); 1387 if (!inode->i_nlink)
1388 set_nlink(inode, 1);
1389 else
1390 btrfs_inc_nlink(inode);
1388 ret = btrfs_update_inode(trans, root, inode); 1391 ret = btrfs_update_inode(trans, root, inode);
1389 } else if (ret == -EEXIST) { 1392 } else if (ret == -EEXIST) {
1390 ret = 0; 1393 ret = 0;