public inbox for linux-fsdevel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Christoph Hellwig <hch@lst.de>
Cc: John Garry <john.g.garry@oracle.com>,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>,
	Chandan Babu R <chandan.babu@oracle.com>,
	Hongbo Li <lihongbo22@huawei.com>,
	Ryusuke Konishi <konishi.ryusuke@gmail.com>,
	linux-nilfs@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-xfs@vger.kernel.org
Subject: Re: [PATCH 4/5] xfs: report the correct read/write dio alignment for reflinked inodes
Date: Wed, 8 Jan 2025 09:20:27 -0800	[thread overview]
Message-ID: <20250108172027.GF1306365@frogsfrogsfrogs> (raw)
In-Reply-To: <20250108151827.GA24499@lst.de>

On Wed, Jan 08, 2025 at 04:18:27PM +0100, Christoph Hellwig wrote:
> On Wed, Jan 08, 2025 at 10:13:02AM +0000, John Garry wrote:
> > On 08/01/2025 08:55, Christoph Hellwig wrote:
> >> @@ -580,9 +580,24 @@ xfs_report_dioalign(
> >>   	struct xfs_buftarg	*target = xfs_inode_buftarg(ip);
> >>   	struct block_device	*bdev = target->bt_bdev;
> >>   -	stat->result_mask |= STATX_DIOALIGN;
> >> +	stat->result_mask |= STATX_DIOALIGN | STATX_DIO_READ_ALIGN;
> >
> > BTW, it would be a crappy userspace which can't handle fields which it did 
> > not ask for, e.g. asked for STATX_DIOALIGN, but got  STATX_DIOALIGN and 
> > STATX_DIO_READ_ALIGN
> 
> Well, the space is marked for extension.  I don't think there ever
> was a requirement only fields asked for are reported, but if that
> feels safer I could switch to that.

From the "Returned information" section of the statx manpage:

"It should be noted that the kernel may return fields that weren't
requested and may fail to return fields that were requested, depending
on what the backing filesystem supports.  (Fields that are given values
despite being unrequested can just be ignored.)  In either case,
stx_mask will not be equal mask.

<snip>

"A filesystem may also fill in fields that the caller didn't ask for if
it has values for them available and the information is available at no
extra cost.  If this happens,  the corresponding bits will be set in
stx_mask."

In other words, the kernel is allowed to return information/flags that
weren't requested, and userspace can ignore it.

--D

  reply	other threads:[~2025-01-08 17:20 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-08  8:55 add STATX_DIO_READ_ALIGN v2 Christoph Hellwig
2025-01-08  8:55 ` [PATCH 1/5] fs: reformat the statx definition Christoph Hellwig
2025-01-08 10:08   ` John Garry
2025-01-08  8:55 ` [PATCH 2/5] fs: add STATX_DIO_READ_ALIGN Christoph Hellwig
2025-01-08 10:09   ` John Garry
2025-01-08  8:55 ` [PATCH 3/5] xfs: cleanup xfs_vn_getattr Christoph Hellwig
2025-01-08  8:55 ` [PATCH 4/5] xfs: report the correct read/write dio alignment for reflinked inodes Christoph Hellwig
2025-01-08 10:10   ` John Garry
2025-01-08 10:13   ` John Garry
2025-01-08 15:18     ` Christoph Hellwig
2025-01-08 17:20       ` Darrick J. Wong [this message]
2025-01-08 17:53   ` Eric Biggers
2025-01-09  6:25     ` Christoph Hellwig
2025-01-08  8:55 ` [PATCH 5/5] xfs: report larger dio alignment for COW inodes Christoph Hellwig
2025-01-08 10:11   ` John Garry
2025-01-08 17:25     ` Darrick J. Wong
2025-01-08  8:59 ` [PATCH] statx.2: document STATX_DIO_READ_ALIGN Christoph Hellwig
2025-01-08 17:27   ` Darrick J. Wong
  -- strict thread matches above, loose matches on Subject: below --
2025-01-09  8:31 add STATX_DIO_READ_ALIGN v3 Christoph Hellwig
2025-01-09  8:31 ` [PATCH 4/5] xfs: report the correct read/write dio alignment for reflinked inodes Christoph Hellwig

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=20250108172027.GF1306365@frogsfrogsfrogs \
    --to=djwong@kernel.org \
    --cc=brauner@kernel.org \
    --cc=chandan.babu@oracle.com \
    --cc=hch@lst.de \
    --cc=jack@suse.cz \
    --cc=john.g.garry@oracle.com \
    --cc=konishi.ryusuke@gmail.com \
    --cc=lihongbo22@huawei.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-nilfs@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --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