]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: recheck bio against block device when we map the bio
authorJosef Bacik <jbacik@fusionio.com>
Fri, 19 Oct 2012 20:50:56 +0000 (16:50 -0400)
committerJosef Bacik <jbacik@fusionio.com>
Tue, 11 Dec 2012 18:31:32 +0000 (13:31 -0500)
commitd680ea9e9ebad97a767758296c6f56e4e4410680
treedc50044005ce08b77dbf1aa896082c6e031850b0
parentff742de5984d5ec3d96be551e3ef1e439068187d
Btrfs: recheck bio against block device when we map the bio

Alex reported a problem where we were writing between chunks on a rbd
device.  The thing is we do bio_add_page using logical offsets, but the
physical offset may be different.  So when we map the bio now check to see
if the bio is still ok with the physical offset, and if it is not split the
bio up and redo the bio_add_page with the physical sector.  This fixes the
problem for Alex and doesn't affect performance in the normal case.  Thanks,

Reported-and-tested-by: Alex Elder <elder@inktank.com>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
fs/btrfs/volumes.c