Re: UAPI value collision: STATX_ATTR_MOUNT_ROOT vs STATX_ATTR_DAX

From: Miklos Szeredi
Date: Wed Nov 25 2020 - 15:44:47 EST


> Related to this, nothing sets STATX_ATTR_DAX into statx->attributes_mask,
> anywhere in the kernel.
>
> The flag is set into statx->attributes in vfs_getattr_nosec(), but that
> does not know whether the particular filesystem under query supports dax
> or not.
>
> This is related to my other email about exactly what attributes_mask
> means, so should STATX_ATTR_DAX be set in statx->attributes_mask only
> in the filesystems that support dax?
>
> (And should that be done only if CONFIG_DAX is turned on, etc?)

I think the mask/flag combinations should mean:

mask:off, flag:off -> value unknown
mask:off, flag:on -> N/A
mask:on, flag:off -> value is off
mask:on, flag:on -> value is on

So mask should be off iff STATX_ATTR_DAX will not be set even if DAX
is enabled on a particular inode (such as on an old kernel not
supporting STATX_ATTR_DAX).

Thanks,
Miklos