| To: | Christoph Hellwig <hch@xxxxxxxxxxxxx> |
|---|---|
| Subject: | Re: [PATCH 06/11] xfs: take the ilock around xfs_bmapi_read in xfs_zero_remaining_bytes |
| From: | Dave Chinner <david@xxxxxxxxxxxxx> |
| Date: | Mon, 9 Dec 2013 09:36:46 +1100 |
| Cc: | xfs@xxxxxxxxxxx |
| Delivered-to: | xfs@xxxxxxxxxxx |
| In-reply-to: | <20131206203128.914019342@xxxxxxxxxxxxxxxxxxxxxx> |
| References: | <20131206203006.914776999@xxxxxxxxxxxxxxxxxxxxxx> <20131206203128.914019342@xxxxxxxxxxxxxxxxxxxxxx> |
| User-agent: | Mutt/1.5.21 (2010-09-15) |
On Fri, Dec 06, 2013 at 12:30:12PM -0800, Christoph Hellwig wrote:
> Signed-off-by: Christoph Hellwig <hch@xxxxxx>
>
> Index: xfs/fs/xfs/xfs_bmap_util.c
> ===================================================================
> --- xfs.orig/fs/xfs/xfs_bmap_util.c 2013-12-06 19:37:36.715162723 +0100
> +++ xfs/fs/xfs/xfs_bmap_util.c 2013-12-06 19:38:45.643161309 +0100
> @@ -1175,9 +1175,15 @@ xfs_zero_remaining_bytes(
> xfs_buf_unlock(bp);
>
> for (offset = startoff; offset <= endoff; offset = lastoffset + 1) {
> + uint lock_mode;
> +
> offset_fsb = XFS_B_TO_FSBT(mp, offset);
> nimap = 1;
> +
> + lock_mode = xfs_ilock_data_map_shared(ip);
> error = xfs_bmapi_read(ip, offset_fsb, 1, &imap, &nimap, 0);
> + xfs_iunlock(ip, lock_mode);
> +
> if (error || nimap < 1)
> break;
> ASSERT(imap.br_blockcount >= 1);
Looks good.
Reviewed-by: Dave Chinner <dchinner@xxxxxxxxxx>
--
Dave Chinner
david@xxxxxxxxxxxxx
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: [PATCH 05/11] xfs: reinstate the ilock in xfs_readdir, Dave Chinner |
|---|---|
| Next by Date: | Re: [PATCH 07/11] xfs: use xfs_ilock_data_map_shared in xfs_qm_dqtobp, Dave Chinner |
| Previous by Thread: | [PATCH 06/11] xfs: take the ilock around xfs_bmapi_read in xfs_zero_remaining_bytes, Christoph Hellwig |
| Next by Thread: | [PATCH 09/11] xfs: use xfs_ilock_attr_map_shared in xfs_attr_get, Christoph Hellwig |
| Indexes: | [Date] [Thread] [Top] [All Lists] |