diff options
author | Christoph Hellwig <hch@infradead.org> | 2013-12-06 15:30:12 -0500 |
---|---|---|
committer | Ben Myers <bpm@sgi.com> | 2013-12-18 16:53:38 -0500 |
commit | 4f317369d46956ccd76b5d28cf66b3f8b24f3480 (patch) | |
tree | 7624a8a8df724da17ae50707d25c2e6eb52ad435 /fs/xfs/xfs_bmap_util.c | |
parent | 40194ecc6d78327d98e66de3213db96ca0a31e6f (diff) |
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>
Diffstat (limited to 'fs/xfs/xfs_bmap_util.c')
-rw-r--r-- | fs/xfs/xfs_bmap_util.c | 6 |
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); |