On Tue, Jul 15, 2025 at 08:02:47AM +0200, Christoph Hellwig wrote: > On Mon, Jul 14, 2025 at 04:53:49PM +0100, John Garry wrote: > > I see. I figure that something like a FS_XFLAG could be used for that. But > > we should still protect bdev fops users as well. > > I'm not sure a XFLAG is all that useful. It's not really a per-file > persistent thing. It's more of a mount option, or better persistent > mount-option attr like we did for autofsck. If we were to make this a mount option it would be really really ugly. Either it is a filesystem specific mount option and then we have the problem that we're ending up with different mount option names per-filesystem. And for a VFS generic mount option this is way too specific. It would be extremely misplaced if we start accumulating hardware opt-out/opt-in mount options on the VFS layer. It feels like this is something that needs to be done on the block layer. IOW, maybe add generic block layer ioctls or a per-device sysfs entry that allows to turn atomic writes on or off. That information would then also potentially available to the filesystem to e.g., generate an info message during mount that hardware atomics are used or aren't used. Because ultimately the block layer is where the decision needs to be made.