linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Christian Brauner <brauner@kernel.org>
Cc: Anuj gupta <anuj1072538@gmail.com>,
	hch@infradead.org, Eric Biggers <ebiggers@kernel.org>,
	Amir Goldstein <amir73il@gmail.com>,
	Anuj Gupta/Anuj Gupta <anuj20.g@samsung.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	jack@suse.cz, axboe@kernel.dk, viro@zeniv.linux.org.uk,
	linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	joshi.k@samsung.com
Subject: Re: [RFC] fs: add ioctl to query protection info capabilities
Date: Wed, 4 Jun 2025 00:57:18 -0700	[thread overview]
Message-ID: <aD_8XsD7gDbURr-M@infradead.org> (raw)
In-Reply-To: <20250604-notgedrungen-korallen-5ffd76cb7329@brauner>

On Wed, Jun 04, 2025 at 09:53:10AM +0200, Christian Brauner wrote:
> On Wed, Jun 04, 2025 at 12:13:38AM +0530, Anuj gupta wrote:
> > > Hm, I wonder whether we should just make all of this an extension of the
> > > new file_getattr() system call we're about to add instead of adding a
> > > separate ioctl for this.
> > 
> > Hi Christian,
> > Thanks for the suggestion to explore file_getattr() for exposing PI
> > capabilities. I spent some time evaluating this path.
> > 
> > Block devices don’t implement inode_operations, including fileattr_get,
> > so invoking file_getattr() on something like /dev/nvme0n1 currently
> > returns -EOPNOTSUPP.  Supporting this would require introducing
> > inode_operations, and then wiring up fileattr_get in the block layer.
> > 
> > Given that, I think sticking with an ioctl may be the cleaner approach.
> > Do you see this differently?
> 
> Would it be so bad to add custom inode operations?
> It's literally just something like:

That doesn't help as the inode operations for the underlying block device
inode won't ever be called.  The visible inode is the block device node
in the containing file system.

Given fileattr get/set seems to be about the actual files in the file
system, using them for something that affects the I/O path for block
device nodes does not feel like a good fit.  And I think the reason they
are inode and not file operations is exactly to be able to cover
attributes always controlled by the containing file system.


  reply	other threads:[~2025-06-04  7:57 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20250527105950epcas5p1b53753ab614bf6bde4ffbf5165c7d263@epcas5p1.samsung.com>
2025-05-27 10:42 ` [RFC] fs: add ioctl to query protection info capabilities Anuj Gupta
2025-05-29  3:02   ` Martin K. Petersen
2025-05-29  7:12     ` Anuj Gupta/Anuj Gupta
2025-05-29 17:59       ` Eric Biggers
2025-05-30  5:24         ` Christian Brauner
2025-06-03 18:43           ` Anuj gupta
2025-06-04  7:53             ` Christian Brauner
2025-06-04  7:57               ` Christoph Hellwig [this message]
2025-06-05  8:24                 ` Christian Brauner
2025-05-29 21:14       ` [RFC] " Andreas Dilger
2025-06-03  3:12       ` [RFC] fs: " Martin K. Petersen
2025-06-03  6:30         ` Christoph Hellwig
2025-06-04  1:48           ` Martin K. Petersen

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=aD_8XsD7gDbURr-M@infradead.org \
    --to=hch@infradead.org \
    --cc=amir73il@gmail.com \
    --cc=anuj1072538@gmail.com \
    --cc=anuj20.g@samsung.com \
    --cc=axboe@kernel.dk \
    --cc=brauner@kernel.org \
    --cc=ebiggers@kernel.org \
    --cc=jack@suse.cz \
    --cc=joshi.k@samsung.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=martin.petersen@oracle.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;
as well as URLs for NNTP newsgroup(s).