aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosef Bacik <jbacik@fusionio.com>2013-06-14 16:58:23 -0400
committerJosef Bacik <jbacik@fusionio.com>2013-07-01 08:52:31 -0400
commitfdf8e2ea3cba9ef03087482b11258d844d6cbea3 (patch)
tree2f20fdf4838107803e69cf27c4bbcc543159b2c9
parent90b6d2830a72ff008c9bbc8dfbf7aaec90be458f (diff)
Btrfs: unlock extent range on enospc in compressed submit
A user reported a deadlock where the async submit thread was blocked on the lock_extent() lock, and then everybody behind him was locked on the page lock for the page he was holding. Looking at the code I noticed we do not unlock the extent range when we get ENOSPC and goto retry. This is bad because we immediately try to lock that range again to do the cow, which will cause a deadlock. Fix this by unlocking the range. Thanks, Signed-off-by: Josef Bacik <jbacik@fusionio.com>
-rw-r--r--fs/btrfs/inode.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index a2df4690b000..509112da6118 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -700,8 +700,12 @@ retry:
700 async_extent->nr_pages = 0; 700 async_extent->nr_pages = 0;
701 async_extent->pages = NULL; 701 async_extent->pages = NULL;
702 702
703 if (ret == -ENOSPC) 703 if (ret == -ENOSPC) {
704 unlock_extent(io_tree, async_extent->start,
705 async_extent->start +
706 async_extent->ram_size - 1);
704 goto retry; 707 goto retry;
708 }
705 goto out_free; 709 goto out_free;
706 } 710 }
707 711