提交 fdf8e2ea 编写于 作者: J Josef Bacik

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: NJosef Bacik <jbacik@fusionio.com>
上级 90b6d283
...@@ -700,8 +700,12 @@ static noinline int submit_compressed_extents(struct inode *inode, ...@@ -700,8 +700,12 @@ static noinline int submit_compressed_extents(struct inode *inode,
async_extent->nr_pages = 0; async_extent->nr_pages = 0;
async_extent->pages = NULL; async_extent->pages = NULL;
if (ret == -ENOSPC) if (ret == -ENOSPC) {
unlock_extent(io_tree, async_extent->start,
async_extent->start +
async_extent->ram_size - 1);
goto retry; goto retry;
}
goto out_free; goto out_free;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册