[PATCH] afs: Fix afs_listxattr() to not list YFS xattrs if a non-YFS server is seen
David Howells
dhowells at redhat.com
Mon Mar 8 22:19:29 GMT 2021
David Howells <dhowells at redhat.com> wrote:
> afs_listxattr() always lists all the available special afs xattrs
> (i.e. those in the "afs.*" space), no matter what sort of server we're
> dealing with. But OpenAFS servers, for example, cannot deal with some of
> the extra-capable attributes that AuriStor (YFS) servers provide.
>
> Unfortunately, the presence of the afs.yfs.* attributes causes errors for
> anything that tries to read them if the server is of the wrong type.
>
> Note that in the case of a mixed environment, where a cell may have a
> volume that is replicated across a set of servers that includes both
> OpenAFS and AuriStor servers, such a volume offers only the capabilities
> available on the OpenAFS servers (so, for example, more capable YFS ACLs
> aren't available in that volume).
>
> Fix afs_listxattr() to only list the afs.yfs.* xattrs if we don't detect
> any OpenAFS servers in the mix for that volume.
>
> To this end, the type of a server is consolidated into its own field in the
> afs_server structure and this is set during probing instead of setting a
> "this is YFS flag". afs_listxattr() can then scan the server list and
> determine what xattrs to present.
>
> As an addition, the server type is displayed in /proc/fs/afs/servers for
> YFS servers to make it easier to check.
>
> Fixes: ae46578b963f ("afs: Get YFS ACLs and information through xattrs")
> Reported-by: Gaja Sophie Peters <gaja.peters at math.uni-hamburg.de>
> Signed-off-by: David Howells <dhowells at redhat.com>
> Link: http://lists.infradead.org/pipermail/linux-afs/2021-March/003508.html
I'll add the following to that:
This can be tested with something like:
getfattr -d -m ".*" /afs/example.com/path/to/file
With this fix, if file is on a volume that is replicated across only yfs
servers, it should show some afs.yfs.* attributes, such as afs.yfs.acl; if
any OpenAFS servers are involved then they should not appear. Without the
fix, the will appear but give errors from the getxattr() syscall.
David
More information about the linux-afs
mailing list