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.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c
index eaab355f5a89..a478f42e63ff 100644
--- a/fs/xfs/xfs_vnodeops.c
+++ b/fs/xfs/xfs_vnodeops.c
@@ -615,6 +615,7 @@ xfs_setattr(
615 code = xfs_igrow_start(ip, vap->va_size, credp); 615 code = xfs_igrow_start(ip, vap->va_size, credp);
616 } 616 }
617 xfs_iunlock(ip, XFS_ILOCK_EXCL); 617 xfs_iunlock(ip, XFS_ILOCK_EXCL);
618 vn_iowait(vp); /* wait for the completion of any pending DIOs */
618 if (!code) 619 if (!code)
619 code = xfs_itruncate_data(ip, vap->va_size); 620 code = xfs_itruncate_data(ip, vap->va_size);
620 if (code) { 621 if (code) {
@@ -1556,7 +1557,7 @@ xfs_release(
1556 if ((error = xfs_inactive_free_eofblocks(mp, ip))) 1557 if ((error = xfs_inactive_free_eofblocks(mp, ip)))
1557 return error; 1558 return error;
1558 /* Update linux inode block count after free above */ 1559 /* Update linux inode block count after free above */
1559 LINVFS_GET_IP(vp)->i_blocks = XFS_FSB_TO_BB(mp, 1560 vn_to_inode(vp)->i_blocks = XFS_FSB_TO_BB(mp,
1560 ip->i_d.di_nblocks + ip->i_delayed_blks); 1561 ip->i_d.di_nblocks + ip->i_delayed_blks);
1561 } 1562 }
1562 } 1563 }
@@ -1637,7 +1638,7 @@ xfs_inactive(
1637 if ((error = xfs_inactive_free_eofblocks(mp, ip))) 1638 if ((error = xfs_inactive_free_eofblocks(mp, ip)))
1638 return VN_INACTIVE_CACHE; 1639 return VN_INACTIVE_CACHE;
1639 /* Update linux inode block count after free above */ 1640 /* Update linux inode block count after free above */
1640 LINVFS_GET_IP(vp)->i_blocks = XFS_FSB_TO_BB(mp, 1641 vn_to_inode(vp)->i_blocks = XFS_FSB_TO_BB(mp,
1641 ip->i_d.di_nblocks + ip->i_delayed_blks); 1642 ip->i_d.di_nblocks + ip->i_delayed_blks);
1642 } 1643 }
1643 goto out; 1644 goto out;
@@ -3186,7 +3187,7 @@ xfs_rmdir(
3186 3187
3187 /* Fall through to std_return with error = 0 or the errno 3188 /* Fall through to std_return with error = 0 or the errno
3188 * from xfs_trans_commit. */ 3189 * from xfs_trans_commit. */
3189std_return: 3190 std_return:
3190 if (DM_EVENT_ENABLED(dir_vp->v_vfsp, dp, DM_EVENT_POSTREMOVE)) { 3191 if (DM_EVENT_ENABLED(dir_vp->v_vfsp, dp, DM_EVENT_POSTREMOVE)) {
3191 (void) XFS_SEND_NAMESP(mp, DM_EVENT_POSTREMOVE, 3192 (void) XFS_SEND_NAMESP(mp, DM_EVENT_POSTREMOVE,
3192 dir_vp, DM_RIGHT_NULL, 3193 dir_vp, DM_RIGHT_NULL,
@@ -3196,12 +3197,12 @@ std_return:
3196 } 3197 }
3197 return error; 3198 return error;
3198 3199
3199error1: 3200 error1:
3200 xfs_bmap_cancel(&free_list); 3201 xfs_bmap_cancel(&free_list);
3201 cancel_flags |= XFS_TRANS_ABORT; 3202 cancel_flags |= XFS_TRANS_ABORT;
3202 /* FALLTHROUGH */ 3203 /* FALLTHROUGH */
3203 3204
3204error_return: 3205 error_return:
3205 xfs_trans_cancel(tp, cancel_flags); 3206 xfs_trans_cancel(tp, cancel_flags);
3206 goto std_return; 3207 goto std_return;
3207} 3208}
@@ -4310,8 +4311,10 @@ xfs_free_file_space(
4310 ASSERT(attr_flags & ATTR_NOLOCK ? attr_flags & ATTR_DMI : 1); 4311 ASSERT(attr_flags & ATTR_NOLOCK ? attr_flags & ATTR_DMI : 1);
4311 if (attr_flags & ATTR_NOLOCK) 4312 if (attr_flags & ATTR_NOLOCK)
4312 need_iolock = 0; 4313 need_iolock = 0;
4313 if (need_iolock) 4314 if (need_iolock) {
4314 xfs_ilock(ip, XFS_IOLOCK_EXCL); 4315 xfs_ilock(ip, XFS_IOLOCK_EXCL);
4316 vn_iowait(vp); /* wait for the completion of any pending DIOs */
4317 }
4315 4318
4316 rounding = MAX((__uint8_t)(1 << mp->m_sb.sb_blocklog), 4319 rounding = MAX((__uint8_t)(1 << mp->m_sb.sb_blocklog),
4317 (__uint8_t)NBPP); 4320 (__uint8_t)NBPP);