aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/linux-2.6/xfs_lrw.c
diff options
context:
space:
mode:
authorLachlan McIlroy <lachlan@sgi.com>2007-05-07 23:49:27 -0400
committerTim Shimmin <tes@sgi.com>2007-05-07 23:49:27 -0400
commitd3cf209476b72c83907a412b6708c5e498410aa7 (patch)
tree5e7a85751ae03b9eb3110e1cfc147b3492ae0fa5 /fs/xfs/linux-2.6/xfs_lrw.c
parent424ea91ba61c1cdc2dac68576c97030cbf47d84f (diff)
[XFS] propogate return codes from flush routines
This patch handles error return values in fs_flush_pages and fs_flushinval_pages. It changes the prototype of fs_flushinval_pages so we can propogate the errors and handle them at higher layers. I also modified xfs_itruncate_start so that it could propogate the error further. SGI-PV: 961990 SGI-Modid: xfs-linux-melb:xfs-kern:28231a Signed-off-by: Lachlan McIlroy <lachlan@sgi.com> Signed-off-by: Stewart Smith <stewart@flamingspork.com> Signed-off-by: Tim Shimmin <tes@sgi.com>
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_lrw.c')
-rw-r--r--fs/xfs/linux-2.6/xfs_lrw.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/fs/xfs/linux-2.6/xfs_lrw.c b/fs/xfs/linux-2.6/xfs_lrw.c
index ff8d64eba9f8..8e46c9798fbf 100644
--- a/fs/xfs/linux-2.6/xfs_lrw.c
+++ b/fs/xfs/linux-2.6/xfs_lrw.c
@@ -191,7 +191,7 @@ xfs_read(
191 struct file *file = iocb->ki_filp; 191 struct file *file = iocb->ki_filp;
192 struct inode *inode = file->f_mapping->host; 192 struct inode *inode = file->f_mapping->host;
193 size_t size = 0; 193 size_t size = 0;
194 ssize_t ret; 194 ssize_t ret = 0;
195 xfs_fsize_t n; 195 xfs_fsize_t n;
196 xfs_inode_t *ip; 196 xfs_inode_t *ip;
197 xfs_mount_t *mp; 197 xfs_mount_t *mp;
@@ -263,9 +263,13 @@ xfs_read(
263 263
264 if (unlikely(ioflags & IO_ISDIRECT)) { 264 if (unlikely(ioflags & IO_ISDIRECT)) {
265 if (VN_CACHED(vp)) 265 if (VN_CACHED(vp))
266 bhv_vop_flushinval_pages(vp, ctooff(offtoct(*offset)), 266 ret = bhv_vop_flushinval_pages(vp, ctooff(offtoct(*offset)),
267 -1, FI_REMAPF_LOCKED); 267 -1, FI_REMAPF_LOCKED);
268 mutex_unlock(&inode->i_mutex); 268 mutex_unlock(&inode->i_mutex);
269 if (ret) {
270 xfs_iunlock(ip, XFS_IOLOCK_SHARED);
271 return ret;
272 }
269 } 273 }
270 274
271 xfs_rw_enter_trace(XFS_READ_ENTER, &ip->i_iocore, 275 xfs_rw_enter_trace(XFS_READ_ENTER, &ip->i_iocore,
@@ -814,8 +818,10 @@ retry:
814 if (need_flush) { 818 if (need_flush) {
815 xfs_inval_cached_trace(io, pos, -1, 819 xfs_inval_cached_trace(io, pos, -1,
816 ctooff(offtoct(pos)), -1); 820 ctooff(offtoct(pos)), -1);
817 bhv_vop_flushinval_pages(vp, ctooff(offtoct(pos)), 821 error = bhv_vop_flushinval_pages(vp, ctooff(offtoct(pos)),
818 -1, FI_REMAPF_LOCKED); 822 -1, FI_REMAPF_LOCKED);
823 if (error)
824 goto out_unlock_internal;
819 } 825 }
820 826
821 if (need_i_mutex) { 827 if (need_i_mutex) {