aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/inode.c
diff options
context:
space:
mode:
authorJosef Bacik <jbacik@fusionio.com>2013-10-25 16:13:35 -0400
committerChris Mason <chris.mason@fusionio.com>2013-11-11 22:07:35 -0500
commit0ef8b726075aa6931ddf1c16f5bae043eef184f9 (patch)
tree61c819e8541c69043a5d74182ac0f8d0060207e7 /fs/btrfs/inode.c
parented2590953bd06b892f0411fc94e19175d32f197a (diff)
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/inode.c')
-rw-r--r--fs/btrfs/inode.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 14c6ab74cf8c..f1fbf903bf9b 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -7236,7 +7236,9 @@ static ssize_t btrfs_direct_IO(int rw, struct kiocb *iocb,
7236 * outstanding dirty pages are on disk. 7236 * outstanding dirty pages are on disk.
7237 */ 7237 */
7238 count = iov_length(iov, nr_segs); 7238 count = iov_length(iov, nr_segs);
7239 btrfs_wait_ordered_range(inode, offset, count); 7239 ret = btrfs_wait_ordered_range(inode, offset, count);
7240 if (ret)
7241 return ret;
7240 7242
7241 if (rw & WRITE) { 7243 if (rw & WRITE) {
7242 /* 7244 /*
@@ -7577,7 +7579,10 @@ static int btrfs_truncate(struct inode *inode)
7577 u64 mask = root->sectorsize - 1; 7579 u64 mask = root->sectorsize - 1;
7578 u64 min_size = btrfs_calc_trunc_metadata_size(root, 1); 7580 u64 min_size = btrfs_calc_trunc_metadata_size(root, 1);
7579 7581
7580 btrfs_wait_ordered_range(inode, inode->i_size & (~mask), (u64)-1); 7582 ret = btrfs_wait_ordered_range(inode, inode->i_size & (~mask),
7583 (u64)-1);
7584 if (ret)
7585 return ret;
7581 7586
7582 /* 7587 /*
7583 * Yes ladies and gentelment, this is indeed ugly. The fact is we have 7588 * Yes ladies and gentelment, this is indeed ugly. The fact is we have