Re: [PATCH 4/4] statx: AFS: Return enhanced file attributes

From: David Howells
Date: Fri Nov 18 2016 - 03:47:17 EST


Andreas Dilger <adilger@xxxxxxxxx> wrote:

> > STATX_ATIME, STATX_CTIME and STATX_BLOCKS are cleared as AFS does not
> > support them.
>
> Rather than clearing specific flags, wouldn't it be better to explicitly
> set the flags that are actually being returned? Otherwise, this would
> have the problem that Dave pointed out on the 0/4 patch, that there may
> be flags still set from userspace that do not mean anything to AFS.

I'm not sure it make a difference. generic_fillattr() has to initialise
result_mask to STATX_BASIC_STATS for the support of any unmodified filesystem.
We can then either clear the bits we don't want or just overwrite the mask
entirely with the bits we do want.

Bits in request_mask that are beyond STATX_BASIC_STATS are not automatically
propagated to result_mask.

Possibly vfs_xgetattr_nosec() should preset the result_mask rather than doing
this in generic_fillattr().

David