Btrfs: fallback on uncompressed io if compressed io fails
authorJosef Bacik <josef@redhat.com>
Wed, 11 Nov 2009 02:23:48 +0000 (21:23 -0500)
committerChris Mason <chris.mason@oracle.com>
Wed, 11 Nov 2009 19:20:20 +0000 (14:20 -0500)
commitf5a84ee3cdd88d96b7bcede10af58598ad8d52a7
tree5f69342df0c457aca31176234a801bf3607978c5
parentccf0e72537a9f68611ca575121afd08e2b4d0fb0
Btrfs: fallback on uncompressed io if compressed io fails

Currently compressed IO does not deal with not having its entire extent able to
be allocated.  So if we have enough free space to allocate for the extent, but
its not contiguous, it will fail spectacularly.  This patch fixes this by
falling back on uncompressed IO which lets us spread the delalloc extent across
multiple extents.  I tested this by making us randomly think the reservation had
failed to make it fallback on the uncompressed io way and it seemed to work
fine.  Thanks,

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