aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/xfs/xfs_bmap_util.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/xfs/xfs_bmap_util.c b/fs/xfs/xfs_bmap_util.c
index 374ba050942f..202a51f7c450 100644
--- a/fs/xfs/xfs_bmap_util.c
+++ b/fs/xfs/xfs_bmap_util.c
@@ -1173,9 +1173,15 @@ xfs_zero_remaining_bytes(
1173 xfs_buf_unlock(bp); 1173 xfs_buf_unlock(bp);
1174 1174
1175 for (offset = startoff; offset <= endoff; offset = lastoffset + 1) { 1175 for (offset = startoff; offset <= endoff; offset = lastoffset + 1) {
1176 uint lock_mode;
1177
1176 offset_fsb = XFS_B_TO_FSBT(mp, offset); 1178 offset_fsb = XFS_B_TO_FSBT(mp, offset);
1177 nimap = 1; 1179 nimap = 1;
1180
1181 lock_mode = xfs_ilock_data_map_shared(ip);
1178 error = xfs_bmapi_read(ip, offset_fsb, 1, &imap, &nimap, 0); 1182 error = xfs_bmapi_read(ip, offset_fsb, 1, &imap, &nimap, 0);
1183 xfs_iunlock(ip, lock_mode);
1184
1179 if (error || nimap < 1) 1185 if (error || nimap < 1)
1180 break; 1186 break;
1181 ASSERT(imap.br_blockcount >= 1); 1187 ASSERT(imap.br_blockcount >= 1);