aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_vnodeops.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_vnodeops.c')
-rw-r--r--fs/xfs/xfs_vnodeops.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c
index 5ed349eccb00..6e49bd362460 100644
--- a/fs/xfs/xfs_vnodeops.c
+++ b/fs/xfs/xfs_vnodeops.c
@@ -1257,8 +1257,12 @@ xfs_inactive_free_eofblocks(
1257 * do that within a transaction. 1257 * do that within a transaction.
1258 */ 1258 */
1259 xfs_ilock(ip, XFS_IOLOCK_EXCL); 1259 xfs_ilock(ip, XFS_IOLOCK_EXCL);
1260 xfs_itruncate_start(ip, XFS_ITRUNC_DEFINITE, 1260 error = xfs_itruncate_start(ip, XFS_ITRUNC_DEFINITE,
1261 ip->i_d.di_size); 1261 ip->i_d.di_size);
1262 if (error) {
1263 xfs_iunlock(ip, XFS_IOLOCK_EXCL);
1264 return error;
1265 }
1262 1266
1263 error = xfs_trans_reserve(tp, 0, 1267 error = xfs_trans_reserve(tp, 0,
1264 XFS_ITRUNCATE_LOG_RES(mp), 1268 XFS_ITRUNCATE_LOG_RES(mp),
@@ -1674,7 +1678,11 @@ xfs_inactive(
1674 */ 1678 */
1675 xfs_ilock(ip, XFS_IOLOCK_EXCL); 1679 xfs_ilock(ip, XFS_IOLOCK_EXCL);
1676 1680
1677 xfs_itruncate_start(ip, XFS_ITRUNC_DEFINITE, 0); 1681 error = xfs_itruncate_start(ip, XFS_ITRUNC_DEFINITE, 0);
1682 if (error) {
1683 xfs_iunlock(ip, XFS_IOLOCK_EXCL);
1684 return VN_INACTIVE_CACHE;
1685 }
1678 1686
1679 error = xfs_trans_reserve(tp, 0, 1687 error = xfs_trans_reserve(tp, 0,
1680 XFS_ITRUNCATE_LOG_RES(mp), 1688 XFS_ITRUNCATE_LOG_RES(mp),
@@ -4338,8 +4346,10 @@ xfs_free_file_space(
4338 if (VN_CACHED(vp) != 0) { 4346 if (VN_CACHED(vp) != 0) {
4339 xfs_inval_cached_trace(&ip->i_iocore, ioffset, -1, 4347 xfs_inval_cached_trace(&ip->i_iocore, ioffset, -1,
4340 ctooff(offtoct(ioffset)), -1); 4348 ctooff(offtoct(ioffset)), -1);
4341 bhv_vop_flushinval_pages(vp, ctooff(offtoct(ioffset)), 4349 error = bhv_vop_flushinval_pages(vp, ctooff(offtoct(ioffset)),
4342 -1, FI_REMAPF_LOCKED); 4350 -1, FI_REMAPF_LOCKED);
4351 if (error)
4352 goto out_unlock_iolock;
4343 } 4353 }
4344 4354
4345 /* 4355 /*