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>
This commit is contained in:
@@ -7236,7 +7236,9 @@ static ssize_t btrfs_direct_IO(int rw, struct kiocb *iocb,
|
||||
* outstanding dirty pages are on disk.
|
||||
*/
|
||||
count = iov_length(iov, nr_segs);
|
||||
btrfs_wait_ordered_range(inode, offset, count);
|
||||
ret = btrfs_wait_ordered_range(inode, offset, count);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (rw & WRITE) {
|
||||
/*
|
||||
@@ -7577,7 +7579,10 @@ static int btrfs_truncate(struct inode *inode)
|
||||
u64 mask = root->sectorsize - 1;
|
||||
u64 min_size = btrfs_calc_trunc_metadata_size(root, 1);
|
||||
|
||||
btrfs_wait_ordered_range(inode, inode->i_size & (~mask), (u64)-1);
|
||||
ret = btrfs_wait_ordered_range(inode, inode->i_size & (~mask),
|
||||
(u64)-1);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
/*
|
||||
* Yes ladies and gentelment, this is indeed ugly. The fact is we have
|
||||
|
Reference in New Issue
Block a user