From: "Darrick J. Wong" <djwong@kernel.org>
To: Christoph Hellwig <hch@infradead.org>
Cc: Christian Brauner <brauner@kernel.org>,
Amir Goldstein <amir73il@gmail.com>,
Alexander Viro <viro@zeniv.linux.org.uk>, Jan Kara <jack@suse.cz>,
Daniel Borkmann <daniel@iogearbox.net>,
Alexei Starovoitov <ast@kernel.org>,
linux-fsdevel@vger.kernel.org, bpf@vger.kernel.org
Subject: Re: [PATCH] bpf: add bpf_real_inode() kfunc
Date: Thu, 26 Mar 2026 23:05:18 -0700 [thread overview]
Message-ID: <20260327060518.GP6202@frogsfrogsfrogs> (raw)
In-Reply-To: <acYVjuDOD7NynO9m@infradead.org>
On Thu, Mar 26, 2026 at 10:28:46PM -0700, Christoph Hellwig wrote:
> No comment on the code, here, but this caught my eye:
>
> On Thu, Mar 26, 2026 at 05:53:44PM +0100, Christian Brauner wrote:
> > This is needed by the dm-verity based execution policy implemented in
> > systemd [1] where BPF LSM hooks must resolve a file's backing block
> > device via inode->i_sb->s_dev.
>
> inode->i_sb->s_dev is not a files backing block device. The only
> think inode->i_sb->s_dev is required to be is the lookup key for
> finding the super block. It also happens to be the default backing
> block device for simple file systems, but once things get a little more
> complicated it often is not. Examples are btrfs where it never matches,
> f2fs additional devices, the XFS RT device, pNFS block layouts and
> probably a few more I forgot.
>
> For the more complex cases like btrfs there might not even be a single
> block device for a file and/or the mapping can change. So please do not
> encode such an assumption anywhere because it is broken.
Seconded. It's a pity that dax_writeback_mapping_range makes nearly the
same mistake...
--D
next prev parent reply other threads:[~2026-03-27 6:05 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-26 16:53 [PATCH] bpf: add bpf_real_inode() kfunc Christian Brauner
2026-03-26 17:02 ` Amir Goldstein
2026-03-27 5:28 ` Christoph Hellwig
2026-03-27 6:05 ` Darrick J. Wong [this message]
2026-04-07 10:25 ` Christian Brauner
2026-04-07 14:54 ` Christoph Hellwig
2026-04-09 13:19 ` Christian Brauner
2026-04-09 14:24 ` Christoph Hellwig
2026-04-09 14:37 ` Gao Xiang
2026-04-09 16:11 ` Christoph Hellwig
2026-04-09 16:42 ` Gao Xiang
2026-04-10 6:15 ` Christoph Hellwig
2026-04-10 6:46 ` Gao Xiang
2026-04-10 7:06 ` Christoph Hellwig
2026-04-10 7:29 ` Gao Xiang
2026-03-27 12:19 ` bot+bpf-ci
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=20260327060518.GP6202@frogsfrogsfrogs \
--to=djwong@kernel.org \
--cc=amir73il@gmail.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=brauner@kernel.org \
--cc=daniel@iogearbox.net \
--cc=hch@infradead.org \
--cc=jack@suse.cz \
--cc=linux-fsdevel@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