History

Btrfs: delay iput with async extents

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.

Josef Bacik committed 14 years ago

Commit cb77fcd1 parent e18fca71 file · +2 −2Browse files

Unified · Split

fs/btrfs/inode.c+2−2
@@ -987,7 +987,7 @@ static noinline void async_cow_start(struct btrfs_work *work) · 986 unmodified lines
987987 async_cow->start, async_cow->end, async_cow,
988988 &num_added);
989989 if (num_added == 0) {
990− iput(async_cow->inode);
990+ btrfs_add_delayed_iput(async_cow->inode);
991991 async_cow->inode = NULL;
992992 }
993993 }
@@ -1023,7 +1023,7 @@ static noinline void async_cow_free(struct btrfs_work *work) · 29 unmodified lines
10231023 struct async_cow *async_cow;
10241024 async_cow = container_of(work, struct async_cow, work);
10251025 if (async_cow->inode)
1026− iput(async_cow->inode);
1026+ btrfs_add_delayed_iput(async_cow->inode);
10271027 kfree(async_cow);
10281028 }
10291029