diff options
author | Josef Bacik <jbacik@fusionio.com> | 2013-10-25 20:13:35 (GMT) |
---|---|---|
committer | Chris Mason <chris.mason@fusionio.com> | 2013-11-12 03:07:35 (GMT) |
commit | 0ef8b726075aa6931ddf1c16f5bae043eef184f9 (patch) | |
tree | 61c819e8541c69043a5d74182ac0f8d0060207e7 /fs/btrfs/free-space-cache.c | |
parent | ed2590953bd06b892f0411fc94e19175d32f197a (diff) | |
download | linux-0ef8b726075aa6931ddf1c16f5bae043eef184f9.tar.xz |
Btrfs: return an error from btrfs_wait_ordered_range
I noticed that if the free space cache has an error writing out it's data it
won't actually error out, it will just carry on. This is because it doesn't
check the return value of btrfs_wait_ordered_range, which didn't actually return
anything. So fix this in order to keep us from making free space cache look
valid when it really isnt. Thanks,
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Diffstat (limited to 'fs/btrfs/free-space-cache.c')
-rw-r--r-- | fs/btrfs/free-space-cache.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c index 4772f3a..d7c445c 100644 --- a/fs/btrfs/free-space-cache.c +++ b/fs/btrfs/free-space-cache.c @@ -1008,8 +1008,13 @@ static int __btrfs_write_out_cache(struct btrfs_root *root, struct inode *inode, if (ret) goto out; - - btrfs_wait_ordered_range(inode, 0, (u64)-1); + ret = btrfs_wait_ordered_range(inode, 0, (u64)-1); + if (ret) { + clear_extent_bit(&BTRFS_I(inode)->io_tree, 0, inode->i_size - 1, + EXTENT_DIRTY | EXTENT_DELALLOC, 0, 0, NULL, + GFP_NOFS); + goto out; + } key.objectid = BTRFS_FREE_SPACE_OBJECTID; key.offset = offset; |