aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/linux-2.6/xfs_lrw.c
diff options
context:
space:
mode:
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) {