From 40a2ec2906f25c821f9db5d479a1447eb26051df Mon Sep 17 00:00:00 2001 From: Chris Mason Date: Tue, 24 Mar 2009 10:24:13 -0400 Subject: [PATCH] --- yaml --- r: 139469 b: refs/heads/master c: a74ac3220774d33db967088906dc3351829e2d3a h: refs/heads/master i: 139467: 790e3d91995474b47a711f9d5c0e07f54917dc85 v: v3 --- [refs] | 2 +- trunk/fs/btrfs/tree-log.c | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 39ee524824e4..fb8c08f3cdb3 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: a4b6e07d1a8a9b907e82b9acbf51a026fbb9301c +refs/heads/master: a74ac3220774d33db967088906dc3351829e2d3a diff --git a/trunk/fs/btrfs/tree-log.c b/trunk/fs/btrfs/tree-log.c index a93934fc93bd..405439ca4c45 100644 --- a/trunk/fs/btrfs/tree-log.c +++ b/trunk/fs/btrfs/tree-log.c @@ -1532,6 +1532,17 @@ static int replay_one_buffer(struct btrfs_root *log, struct extent_buffer *eb, root, inode, inode->i_size, BTRFS_EXTENT_DATA_KEY); BUG_ON(ret); + + /* if the nlink count is zero here, the iput + * will free the inode. We bump it to make + * sure it doesn't get freed until the link + * count fixup is done + */ + if (inode->i_nlink == 0) { + btrfs_inc_nlink(inode); + btrfs_update_inode(wc->trans, + root, inode); + } iput(inode); } ret = link_to_fixup_dir(wc->trans, root,