linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Btrfs: delay iput with async extents
@ 2012-06-15 17:40 Josef Bacik
  0 siblings, 0 replies; only message in thread
From: Josef Bacik @ 2012-06-15 17:40 UTC (permalink / raw)
  To: linux-btrfs, chris.mason

There is some concern that these iput()'s could be the final iputs and could
induce lockups on people waiting on writeback.  This would happen in the
rare case that we don't create ordered extents because of an error, but it
is theoretically possible and we already have a mechanism to deal with this
so just make them delayed iputs to negate any worry.  Thanks,

Signed-off-by: Josef Bacik <josef@redhat.com>
---
 fs/btrfs/inode.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index fe3073e..a78f5c7 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -987,7 +987,7 @@ static noinline void async_cow_start(struct btrfs_work *work)
 			    async_cow->start, async_cow->end, async_cow,
 			    &num_added);
 	if (num_added == 0) {
-		iput(async_cow->inode);
+		btrfs_add_delayed_iput(async_cow->inode);
 		async_cow->inode = NULL;
 	}
 }
@@ -1022,8 +1022,10 @@ static noinline void async_cow_free(struct btrfs_work *work)
 {
 	struct async_cow *async_cow;
 	async_cow = container_of(work, struct async_cow, work);
-	if (async_cow->inode)
+	if (async_cow->inode) {
+		btrfs_add_delayed_iput(async_cow->inode);
 		iput(async_cow->inode);
+	}
 	kfree(async_cow);
 }
 
-- 
1.7.7.6


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2012-06-15 17:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-15 17:40 [PATCH] Btrfs: delay iput with async extents Josef Bacik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).