From: "Darrick J. Wong" <djwong@kernel.org>
To: Matthias Goergens <matthias.goergens@gmail.com>
Cc: linux-fsdevel@vger.kernel.org, viro@zeniv.linux.org.uk,
brauner@kernel.org, jack@suse.cz, linux-kernel@vger.kernel.org,
hch@infradead.org, david@fromorbit.com, amir73il@gmail.com,
ansgar.loesser@kom.tu-darmstadt.de
Subject: Re: [PATCH v5 1/2] dax: return the comparison error from dax_dedupe_file_range_compare()
Date: Sun, 27 Sep 2026 08:01:29 -0700 [thread overview]
Message-ID: <20260927150129.GE6244@frogsfrogsfrogs> (raw)
In-Reply-To: <20260926043836.3301898-2-matthias.goergens@gmail.com>
On Sat, Sep 26, 2026 at 12:38:35PM +0800, Matthias Goergens wrote:
> dax_dedupe_file_range_compare() returns ret, the positive result of the
> last iomap_iter() call, when dax_range_compare_iter() fails. The caller
> treats any non-zero return as the result of the range preparation, and
> xfs_file_remap_range() returns it as the remap result, so a failed
> comparison on a DAX file reports success with a small positive length
> instead of the error.
>
> Return the error itself.
>
> Fixes: 0e79e3736d54 ("fsdax: dedupe: iter two files at the same time")
> Signed-off-by: Matthias Goergens <matthias.goergens@gmail.com>
That seems like a bug, I'm sorta surprised nobody noticed...
Cc: <stable@vger.kernel.org> # v6.2
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
--D
> ---
> fs/dax.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/dax.c b/fs/dax.c
> index 1fbba0d21c13..de11bbbb6a38 100644
> --- a/fs/dax.c
> +++ b/fs/dax.c
> @@ -2264,7 +2264,7 @@ int dax_dedupe_file_range_compare(struct inode *src, loff_t srcoff,
> status = dax_range_compare_iter(&src_iter, &dst_iter,
> min(src_iter.len, dst_iter.len), same);
> if (status < 0)
> - return ret;
> + return status;
> src_iter.status = dst_iter.status = status;
> }
> return ret;
> --
> 2.55.0
>
>
next prev parent reply other threads:[~2026-09-27 15:01 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-26 4:38 [PATCH v5 0/2] vfs: add FILE_DEDUPE_RANGE_REPORT_PROGRESS flag to FIDEDUPERANGE Matthias Goergens
2026-09-26 4:38 ` [PATCH v5 1/2] dax: return the comparison error from dax_dedupe_file_range_compare() Matthias Goergens
2026-09-27 15:01 ` Darrick J. Wong [this message]
2026-09-26 4:38 ` [PATCH v5 2/2] vfs: add FILE_DEDUPE_RANGE_REPORT_PROGRESS flag to FIDEDUPERANGE Matthias Goergens
2026-09-27 7:27 ` Amir Goldstein
2026-09-27 15:02 ` Darrick J. Wong
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=20260927150129.GE6244@frogsfrogsfrogs \
--to=djwong@kernel.org \
--cc=amir73il@gmail.com \
--cc=ansgar.loesser@kom.tu-darmstadt.de \
--cc=brauner@kernel.org \
--cc=david@fromorbit.com \
--cc=hch@infradead.org \
--cc=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=matthias.goergens@gmail.com \
--cc=viro@zeniv.linux.org.uk \
/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
all inboxes | Powered by JetHome®