listxattr separate for yfs and openafs

David Howells dhowells at redhat.com
Mon Mar 8 11:53:09 GMT 2021


Gaja Sophie Peters <gaja.peters at math.uni-hamburg.de> wrote:

> -		inode->i_op	= &afs_file_inode_operations;
> +		if (test_bit(AFS_SERVER_FL_IS_YFS, &op->server->flags))
> +			inode->i_op	= &yfs_file_inode_operations;
> +		else
> +			inode->i_op	= &afs_file_inode_operations;

Unfortunately, this won't work.  The problem is if you have a read-only volume
that is distributed across a collection of YFS and non-YFS servers, we may
switch from server to server whilst we're reading the file - we could even
read different parts of the same file from different servers concurrently.

The YFS server, however, responds as a YFS server, even if the volume it's
serving doesn't support YFS features because it's replicated on an OpenAFS
server.

We can't change the inode operations table once we've set them, so we have to
do it elsewhere.

I think the way to do this is to loop through the vnode->volume->servers in
afs_listxattr() and see if any of them have don't have AFS_SERVER_FL_IS_YFS
set.

This is slightly complicated by the fact than an unprobed server will not have
AFS_SERVER_FL_IS_YFS set either, so we may need a second flag,
AFS_SERVER_FL_NOT_YFS, that is set if the server responded, but wasn't a YFS
server - then look for that being set.

The result of detecting an OpenAFS server can then be cached in
vnode->volume->flags to shortcut that process next time.  We'd probably want
to zap the flag, though, if the volume creation date changes.

Would you like to have a go at that, or shall I do it?

David




More information about the linux-afs mailing list