aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosef Bacik2013-03-01 12:35:47 -0600
committerGreg Kroah-Hartman2013-04-05 11:26:02 -0500
commitb9cde88f39769f464346db07253ce926e671a6e7 (patch)
tree335c0b7d85eace139ecc44ff93f09e20f4fadeae /fs/btrfs/tree-log.c
parentcfc13c72f4642f811c159cceb921df69cd158725 (diff)
downloadkernel-omap-b9cde88f39769f464346db07253ce926e671a6e7.tar.gz
kernel-omap-b9cde88f39769f464346db07253ce926e671a6e7.tar.xz
kernel-omap-b9cde88f39769f464346db07253ce926e671a6e7.zip
Btrfs: use set_nlink if our i_nlink is 0
commit 9bf7a4890518186238d2579be16ecc5190a707c0 upstream. We need to inc the nlink of deleted entries when running replay so we can do the unlink on the fs_root and get everything cleaned up and then have the orphan cleanup do the right thing. The problem is inc_nlink complains about this, even thought it still does the right thing. So use set_nlink() if our i_nlink is 0 to keep users from seeing the warnings during log replay. Thanks, Signed-off-by: Josef Bacik <jbacik@fusionio.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
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;