direct-io: do not merge logically non-contiguous requests
authorJosef Bacik <josef@redhat.com>
Sun, 23 May 2010 15:00:55 +0000 (11:00 -0400)
committerChris Mason <chris.mason@oracle.com>
Tue, 25 May 2010 14:34:56 +0000 (10:34 -0400)
commitc2c6ca417e2db7a519e6e92c82f4a933d940d076
tree4b5f71682270b151e38e9649a40da30564dacfdd
parentfacd07b07d2a7988f5ce849558838cc953847637
direct-io: do not merge logically non-contiguous requests

Btrfs cannot handle having logically non-contiguous requests submitted.  For
example if you have

Logical:  [0-4095][HOLE][8192-12287]
Physical: [0-4095]      [4096-8191]

Normally the DIO code would put these into the same BIO's.  The problem is we
need to know exactly what offset is associated with what BIO so we can do our
checksumming and unlocking properly, so putting them in the same BIO doesn't
work.  So add another check where we submit the current BIO if the physical
blocks are not contigous OR the logical blocks are not contiguous.

Signed-off-by: Josef Bacik <josef@redhat.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/direct-io.c