From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Christoph Hellwig <hch@lst.de>
Cc: linux-xfs@vger.kernel.org, Brian Foster <bfoster@redhat.com>
Subject: Re: [PATCH 09/10] xfs: remove the truncate short cut in xfs_map_blocks
Date: Fri, 15 Feb 2019 15:37:42 -0800 [thread overview]
Message-ID: <20190215233742.GS32253@magnolia> (raw)
In-Reply-To: <20190215144725.8894-10-hch@lst.de>
On Fri, Feb 15, 2019 at 03:47:24PM +0100, Christoph Hellwig wrote:
> Now that we properly handle the race with truncate in the delalloc
> allocator there is no need to short cut this exceptional case earlier
> on.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> Reviewed-by: Brian Foster <bfoster@redhat.com>
Looks ok modulo my comments in patch 10/10,
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
--D
> ---
> fs/xfs/xfs_aops.c | 20 --------------------
> 1 file changed, 20 deletions(-)
>
> diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c
> index 42017ecf78ed..a6abb7125203 100644
> --- a/fs/xfs/xfs_aops.c
> +++ b/fs/xfs/xfs_aops.c
> @@ -420,26 +420,6 @@ xfs_map_blocks(
> xfs_iunlock(ip, XFS_ILOCK_SHARED);
>
> wpc->fork = XFS_COW_FORK;
> -
> - /*
> - * Truncate can race with writeback since writeback doesn't
> - * take the iolock and truncate decreases the file size before
> - * it starts truncating the pages between new_size and old_size.
> - * Therefore, we can end up in the situation where writeback
> - * gets a CoW fork mapping but the truncate makes the mapping
> - * invalid and we end up in here trying to get a new mapping.
> - * bail out here so that we simply never get a valid mapping
> - * and so we drop the write altogether. The page truncation
> - * will kill the contents anyway.
> - */
> - if (offset > i_size_read(inode)) {
> - wpc->imap.br_blockcount = end_fsb - offset_fsb;
> - wpc->imap.br_startoff = offset_fsb;
> - wpc->imap.br_startblock = HOLESTARTBLOCK;
> - wpc->imap.br_state = XFS_EXT_NORM;
> - return 0;
> - }
> -
> goto allocate_blocks;
> }
>
> --
> 2.20.1
>
next prev parent reply other threads:[~2019-02-15 23:37 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-15 14:47 small fixes and optimizations for delalloc v2 Christoph Hellwig
2019-02-15 14:47 ` [PATCH 01/10] xfs: remove the io_type field from the writeback context and ioend Christoph Hellwig
2019-02-15 14:47 ` [PATCH 02/10] xfs: remove the s_maxbytes checks in xfs_map_blocks Christoph Hellwig
2019-02-15 14:47 ` [PATCH 03/10] xfs: simplify the xfs_bmap_btree_to_extents calling conventions Christoph Hellwig
2019-02-15 16:41 ` Darrick J. Wong
2019-02-15 14:47 ` [PATCH 04/10] xfs: factor out two helpers from xfs_bmapi_write Christoph Hellwig
2019-02-15 22:37 ` Darrick J. Wong
2019-02-15 14:47 ` [PATCH 05/10] xfs: split XFS_BMAPI_DELALLOC handling " Christoph Hellwig
2019-02-15 23:38 ` Darrick J. Wong
2019-02-15 14:47 ` [PATCH 06/10] xfs: move transaction handling to xfs_bmapi_convert_delalloc Christoph Hellwig
2019-02-15 22:49 ` Darrick J. Wong
2019-02-15 14:47 ` [PATCH 07/10] xfs: move stat accounting " Christoph Hellwig
2019-02-15 22:47 ` Darrick J. Wong
2019-02-15 14:47 ` [PATCH 08/10] xfs: move xfs_iomap_write_allocate to xfs_aops.c Christoph Hellwig
2019-02-15 23:40 ` Darrick J. Wong
2019-02-15 14:47 ` [PATCH 09/10] xfs: remove the truncate short cut in xfs_map_blocks Christoph Hellwig
2019-02-15 23:37 ` Darrick J. Wong [this message]
2019-02-15 14:47 ` [PATCH 10/10] xfs: retry COW fork delalloc conversion when no Christoph Hellwig
2019-02-15 23:32 ` Darrick J. Wong
2019-02-18 9:09 ` Christoph Hellwig
2019-02-19 5:19 ` Darrick J. Wong
-- strict thread matches above, loose matches on Subject: below --
2019-02-11 12:54 small fixes and optimizations for delalloc and reflink Christoph Hellwig
2019-02-11 12:54 ` [PATCH 09/10] xfs: remove the truncate short cut in xfs_map_blocks Christoph Hellwig
2019-02-11 15:22 ` Brian Foster
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190215233742.GS32253@magnolia \
--to=darrick.wong@oracle.com \
--cc=bfoster@redhat.com \
--cc=hch@lst.de \
--cc=linux-xfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.