Re: [PATCH 0/6] xfs: BPF data placement policy for zoned file systems
From: Christoph Hellwig
Date: Tue Dec 01 2026 - 04:16:01 EST
On Tue, Dec 01, 2026 at 04:56:50AM +0000, Alexei Starovoitov wrote:
> You waited since ALPSS to send this?
> Sorry, but the whole thing is an overkill if 'hint' is the only goal.
> Here is a much simpler alternative:
I have no idea how you think this helps?
> SEC("lsm/file_open")
Requiring LSM privileges for hints is not helpful.
>
> int BPF_PROG(set_hint, struct file *file)
> {
> struct dentry *dentry = file->f_path.dentry;
> struct key key = {
> .dev = dentry->d_sb->s_dev,
> .dir = dentry->d_parent->d_inode->i_ino,
FYI, ->d_parent dereferences aren't stable.
> };
> u64 *hint;
>
> if (!(file->f_mode & FMODE_WRITE))
> return 0;
> hint = bpf_map_lookup_elem(&hints, &key);
> if (hint)
> bpf_file_set_write_hint(file, *hint);
This assumes you want to set hints on specific and not relative
path, and encodes a really bad and mostly broken ABI in a userspace
ABI due to the shared maps. But even with that you can't easily
match for cgroup ID and other bits in here. And for anything we'd
want to deploy the concept of a shared map with an implicit ABI
is just a nightmare.