Skip to contentSkip to conversation

Btrfs: delay iput with async extents V2

PATCH New Josef Bacik 1 participant 1 message Jun 15, 2012 Btrfs file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Btrfs: delay iput with async extents V2

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,

---
V1->V2: Drop the iput in async_cow_free, I'm an idiot.

 fs/btrfs/inode.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
fs/btrfs/inode.c +2 -2
index fe3073e..a95ef03 100644
@@ -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;
 	}
 }
@@ -1023,7 +1023,7 @@ 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)
-		iput(async_cow->inode);
+		btrfs_add_delayed_iput(async_cow->inode);
 	kfree(async_cow);
 }
 
Signature · 1 line
1.7.7.6