diff options
Diffstat (limited to 'fs/btrfs/tree-log.c')
-rw-r--r-- | fs/btrfs/tree-log.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index c7ef569eb22a..451fad96ecd1 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c | |||
@@ -1382,7 +1382,10 @@ static noinline int link_to_fixup_dir(struct btrfs_trans_handle *trans, | |||
1382 | 1382 | ||
1383 | btrfs_release_path(path); | 1383 | btrfs_release_path(path); |
1384 | if (ret == 0) { | 1384 | if (ret == 0) { |
1385 | btrfs_inc_nlink(inode); | 1385 | if (!inode->i_nlink) |
1386 | set_nlink(inode, 1); | ||
1387 | else | ||
1388 | btrfs_inc_nlink(inode); | ||
1386 | ret = btrfs_update_inode(trans, root, inode); | 1389 | ret = btrfs_update_inode(trans, root, inode); |
1387 | } else if (ret == -EEXIST) { | 1390 | } else if (ret == -EEXIST) { |
1388 | ret = 0; | 1391 | ret = 0; |