Re:[PATCH] xfs: getattr ignore blocks beyond eof

From: wang.yi59
Date: Fri Apr 01 2022 - 04:10:02 EST


> On Thu, Mar 31, 2022 at 04:32:07PM +0800, wang.yi59@xxxxxxxxxx wrote:
> > > We do not, and have not ever tried to, hide allocation or block
> > > usage artifacts from userspace because any application that depends
> > > on specific block allocation patterns or accounting from the
> > > filesystem is broken by design.
> > >
> > > If your application is dependent on block counts exactly matching
> > > the file data space for waht ever reason, then what speculative
> > > preallocation does is the least of your problems.
> > >
> >
> > Thanks for your explaination.
> >
> > Unfortunately, the app I'm using evaluates diskusage by querying
> > the changes of the backend filesystem (XFS) file before and after
> > the operation.
>
> What application is this?
>
> What is it trying to use this information for?

Thanks very much, Dave.

I'm trying to use a new xlater(module) named 'simple-quota' in
glusterfs, which collects file's diskusage by stat, for quota function.

>
> I'm trying to understand why someone thought this was a good idea,
> and without actually being able to look up the code and see what it
> is using the information for, I can't really say much more than
> "this seems broken by design".
>
> > Without giving up the benefits of preallocation, the
> > app's statistics will become obsolete and no chance to correct it
> > at a small cost, because of the silence reclaim of posteof blocks.
> > That is the app's problem.