From: "Darrick J. Wong" <djwong@kernel.org>
To: Pankaj Raghav <p.raghav@samsung.com>
Cc: aalbersh@kernel.org, pankaj.raghav@linux.dev,
linux-xfs@vger.kernel.org, Zhang Yi <yi.zhang@huaweicloud.com>,
hch@lst.de, gost.dev@samsung.com
Subject: Re: [PATCH v2] fiemap: add a nosync option
Date: Tue, 14 Jul 2026 12:38:05 -0700 [thread overview]
Message-ID: <20260714193805.GH7380@frogsfrogsfrogs> (raw)
In-Reply-To: <20260714192921.2528965-1-p.raghav@samsung.com>
On Tue, Jul 14, 2026 at 09:29:21PM +0200, Pankaj Raghav wrote:
> io/fiemap adds FIEMAP_FLAG_SYNC by default. There are some test cases
> where adding this flag might have an undesired side effect on the
> results [1].
>
> Add an option that does not pass FIEMAP_FLAG_SYNC flag.
>
> [1] https://lore.kernel.org/linux-xfs/ca21b3c4-e1df-4ba7-8e9c-5d221337c86b@huaweicloud.com/
>
> Signed-off-by: Pankaj Raghav <p.raghav@samsung.com>
> ---
> Changes since v1:
> - Change '-s' to '-e' to match xfs_bmap (Christoph).
>
> io/fiemap.c | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/io/fiemap.c b/io/fiemap.c
> index b41f71bf..b2e89b95 100644
> --- a/io/fiemap.c
> +++ b/io/fiemap.c
> @@ -36,6 +36,7 @@ fiemap_help(void)
> " -a -- prints the attribute fork map instead of the data fork.\n"
> " -l -- also displays the length of each extent in 512-byte blocks.\n"
> " -n -- query n extents.\n"
> +" -e -- do not use FIEMAP_FLAG_SYNC.\n"
Needs an xfs_io(8) manpage update, but otherwise this looks good to me.
--D
> " -v -- Verbose information\n"
> " offset is the starting offset to map, and is optional. If offset is\n"
> " specified, mapping length may (optionally) be specified as well."
> @@ -242,7 +243,7 @@ fiemap_f(
>
> init_cvtnum(&fsblocksize, &fssectsize);
>
> - while ((c = getopt(argc, argv, "aln:v")) != EOF) {
> + while ((c = getopt(argc, argv, "aln:ev")) != EOF) {
> switch (c) {
> case 'a':
> fiemap_flags |= FIEMAP_FLAG_XATTR;
> @@ -253,6 +254,10 @@ fiemap_f(
> case 'n':
> max_extents = atoi(optarg);
> break;
> + case 'e':
> + /* nosync */
> + fiemap_flags &= ~(FIEMAP_FLAG_SYNC);
> + break;
> case 'v':
> vflag++;
> break;
> @@ -393,7 +398,7 @@ fiemap_init(void)
> fiemap_cmd.argmin = 0;
> fiemap_cmd.argmax = -1;
> fiemap_cmd.flags = CMD_NOMAP_OK | CMD_FOREIGN_OK;
> - fiemap_cmd.args = _("[-alv] [-n nx] [offset [len]]");
> + fiemap_cmd.args = _("[-alev] [-n nx] [offset [len]]");
> fiemap_cmd.oneline = _("print block mapping for a file");
> fiemap_cmd.help = fiemap_help;
>
>
> base-commit: e80b048d87fdc5735e0d03ae29b497b402ea8bbe
> --
> 2.51.2
>
>
prev parent reply other threads:[~2026-07-14 19:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-14 19:29 [PATCH v2] fiemap: add a nosync option Pankaj Raghav
2026-07-14 19:38 ` Darrick J. Wong [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=20260714193805.GH7380@frogsfrogsfrogs \
--to=djwong@kernel.org \
--cc=aalbersh@kernel.org \
--cc=gost.dev@samsung.com \
--cc=hch@lst.de \
--cc=linux-xfs@vger.kernel.org \
--cc=p.raghav@samsung.com \
--cc=pankaj.raghav@linux.dev \
--cc=yi.zhang@huaweicloud.com \
/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