From: Brian Foster <bfoster@redhat.com>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH 2/2] xfs: fix partially uninitialized structure in xfs_reflink_remap_extent
Date: Mon, 13 Apr 2020 08:31:17 -0400 [thread overview]
Message-ID: <20200413123117.GC57285@bfoster> (raw)
In-Reply-To: <158674022396.3253017.2093178484820838524.stgit@magnolia>
On Sun, Apr 12, 2020 at 06:10:24PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
>
> In the reflink extent remap function, it turns out that uirec (the block
> mapping corresponding only to the part of the passed-in mapping that got
> unmapped) was not fully initialized. Specifically, br_state was not
> being copied from the passed-in struct to the uirec. This could lead to
> unpredictable results such as the reflinked mapping being marked
> unwritten in the destination file.
>
> Fixes: 862bb360ef569 ("xfs: reflink extents from one file to another")
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---
Reviewed-by: Brian Foster <bfoster@redhat.com>
> fs/xfs/xfs_reflink.c | 1 +
> 1 file changed, 1 insertion(+)
>
>
> diff --git a/fs/xfs/xfs_reflink.c b/fs/xfs/xfs_reflink.c
> index b0ce04ffd3cd..107bf2a2f344 100644
> --- a/fs/xfs/xfs_reflink.c
> +++ b/fs/xfs/xfs_reflink.c
> @@ -1051,6 +1051,7 @@ xfs_reflink_remap_extent(
> uirec.br_startblock = irec->br_startblock + rlen;
> uirec.br_startoff = irec->br_startoff + rlen;
> uirec.br_blockcount = unmap_len - rlen;
> + uirec.br_state = irec->br_state;
> unmap_len = rlen;
>
> /* If this isn't a real mapping, we're done. */
>
prev parent reply other threads:[~2020-04-13 12:31 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-13 1:10 [PATCH 0/2] xfs: random fixes for 5.7 Darrick J. Wong
2020-04-13 1:10 ` [PATCH 1/2] xfs: move inode flush to a workqueue Darrick J. Wong
2020-04-13 12:31 ` Brian Foster
2020-04-14 0:31 ` Darrick J. Wong
2020-04-14 9:06 ` Dave Chinner
2020-04-15 4:14 ` Darrick J. Wong
2020-04-13 1:10 ` [PATCH 2/2] xfs: fix partially uninitialized structure in xfs_reflink_remap_extent Darrick J. Wong
2020-04-13 12:31 ` Brian Foster [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=20200413123117.GC57285@bfoster \
--to=bfoster@redhat.com \
--cc=darrick.wong@oracle.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).