From: Brian Behlendorf Date: Thu, 8 Nov 2012 22:18:22 +0000 (-0800) Subject: Fix zvol+btrfs hang X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=commitdiff_plain;ds=sidebyside;h=e26ade5101ba1d8e8350ff1270bfca4258e1ffe3;hp=e26ade5101ba1d8e8350ff1270bfca4258e1ffe3;p=zfs.git 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 Signed-off-by: Brian Behlendorf Closes #469 ---