]> git.proxmox.com Git - mirror_zfs.git/commit
Fix zvol+btrfs hang
authorBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 8 Nov 2012 22:18:22 +0000 (14:18 -0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 9 Nov 2012 20:24:51 +0000 (12:24 -0800)
commite26ade5101ba1d8e8350ff1270bfca4258e1ffe3
tree7d7642323fa0fa7e18e0d875986c9b2e8b80b512
parentbbf8c748051294b104678f101ba1162632099b07
Fix zvol+btrfs hang

When using a zvol to back a btrfs filesystem the btrfs mount
would hang.  This was due to the bio completion callback used
in btrfs assuming that lower level drivers would never modify
the bio->bi_io_vecs after they were submitted via bio_submit().
If they are modified btrfs will miscalculate which pages need
to be unlocked resulting in a hang.

It's worth mentioning that other file systems such as ext[234]
and xfs work fine because they do not make the same assumption
in the bio completion callback.

The most straight forward way to fix the issue is to present
the semantics expected by btrfs.  This is done by cloning the
bios attached to each request and then using the clones bvecs
to perform the required accounting.  The clones are freed after
each read/write and the original unmodified bios are linked back
in to the request.

Signed-off-by: Chris Wedgwood <cw@f00f.org>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #469
module/zfs/dmu.c