From: Dave Chinner <david@fromorbit.com>
To: Brian Foster <bfoster@redhat.com>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH] xfs: add missing error check in xfs_prepare_shift()
Date: Mon, 29 Apr 2019 08:41:45 +1000 [thread overview]
Message-ID: <20190428224145.GG29573@dread.disaster.area> (raw)
In-Reply-To: <20190426120633.36420-1-bfoster@redhat.com>
On Fri, Apr 26, 2019 at 08:06:33AM -0400, Brian Foster wrote:
> xfs_prepare_shift() fails to check the error return from
> xfs_flush_unmap_range(). If the latter fails, that could lead to an
> insert/collapse range operation over a delalloc range, which is not
> supported.
>
> Add an error check and return appropriately. This is reproduced
> rarely by generic/475.
>
> Signed-off-by: Brian Foster <bfoster@redhat.com>
> ---
> fs/xfs/xfs_bmap_util.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/fs/xfs/xfs_bmap_util.c b/fs/xfs/xfs_bmap_util.c
> index 2db43ff4f8b5..06d07f1e310b 100644
> --- a/fs/xfs/xfs_bmap_util.c
> +++ b/fs/xfs/xfs_bmap_util.c
> @@ -1193,6 +1193,8 @@ xfs_prepare_shift(
> * about to shift down every extent from offset to EOF.
> */
> error = xfs_flush_unmap_range(ip, offset, XFS_ISIZE(ip));
> + if (error)
> + return error;
Urk. My fault.
Fixes: 7f9f71be84bc ("xfs: extent shifting doesn't fully invalidate page cache")
Not sure how I screwed up that simple change so obviously and didn't
notice it.
Fix for the fix looks good.
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
prev parent reply other threads:[~2019-04-28 22:41 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-26 12:06 [PATCH] xfs: add missing error check in xfs_prepare_shift() Brian Foster
2019-04-26 14:30 ` Darrick J. Wong
2019-04-26 23:39 ` Allison Henderson
2019-04-28 22:41 ` Dave Chinner [this message]
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=20190428224145.GG29573@dread.disaster.area \
--to=david@fromorbit.com \
--cc=bfoster@redhat.com \
--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.