xfs: take the ilock around xfs_bmapi_read in xfs_zero_remaining_bytes
Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Ben Myers <bpm@sgi.com>
This commit is contained in:
parent
40194ecc6d
commit
4f317369d4
1 changed files with 6 additions and 0 deletions
|
@ -1173,9 +1173,15 @@ xfs_zero_remaining_bytes(
|
||||||
xfs_buf_unlock(bp);
|
xfs_buf_unlock(bp);
|
||||||
|
|
||||||
for (offset = startoff; offset <= endoff; offset = lastoffset + 1) {
|
for (offset = startoff; offset <= endoff; offset = lastoffset + 1) {
|
||||||
|
uint lock_mode;
|
||||||
|
|
||||||
offset_fsb = XFS_B_TO_FSBT(mp, offset);
|
offset_fsb = XFS_B_TO_FSBT(mp, offset);
|
||||||
nimap = 1;
|
nimap = 1;
|
||||||
|
|
||||||
|
lock_mode = xfs_ilock_data_map_shared(ip);
|
||||||
error = xfs_bmapi_read(ip, offset_fsb, 1, &imap, &nimap, 0);
|
error = xfs_bmapi_read(ip, offset_fsb, 1, &imap, &nimap, 0);
|
||||||
|
xfs_iunlock(ip, lock_mode);
|
||||||
|
|
||||||
if (error || nimap < 1)
|
if (error || nimap < 1)
|
||||||
break;
|
break;
|
||||||
ASSERT(imap.br_blockcount >= 1);
|
ASSERT(imap.br_blockcount >= 1);
|
||||||
|
|
Loading…
Reference in a new issue