Re: [PATCH] loop: Disable fallocate() zero and discard if not supported

From: Christoph Hellwig
Date: Mon Jun 10 2024 - 10:15:23 EST


On Mon, Jun 10, 2024 at 04:13:23PM +0200, Cyril Hrubis wrote:
> Do we need noinline attribute for the function as well or unlikely() in
> the if condition?

unlikely sounds like the right thing here.

> > (and maybe one day we figure out a way for the file system to
> > advertise what fallocate modes it actually supports..)
>
> One of my ideas was to try fallocate() with zero size in the
> loop_reconfigure_limits() to see if we get EOPNOTSUPP but for that to
> work we would have to make sure that we do not bail early on zero size
> in the vfs layer...

And the VFS layer doesn't know, it has to go all the way into the
file system..