listxattr separate for yfs and openafs

Gaja Sophie Peters gaja.peters at math.uni-hamburg.de
Sun Mar 7 18:30:31 GMT 2021


Am 04.03.21 um 09:21 schrieb David Howells:

> Yeah, I really need to make listxattr not list those if we're not talking to a
> YFS server - but that's a separate patch.

Oh, definitely a separate patch, the crash was the most important.
Thanks for getting that fixed so fast.

As to the "separate patch" regarding listxattr, I managed to patch it
for myself, so that openafs-cells show only afs.* xattrs and yfs-cells
show also afs.yfs.* xattrs.

I repeat that I am no kernel-developer, so the way I managed that
probably breaks a few dozen rules, however, it seems to work for me. If
you're interested, I can send you (or the linux-afs list) my patch.

Basically, I duplicated a few structures and commands afs_* to yfs_*
that refer in some way to afs_listxattr and made a separate yfs_listxattr:

duplicating in xattr.c:
	yfs_xattr_list (and reducing the original afs_xattr_list)
	yfs_listxattr
duplicating in dir.c:
	yfs_dir_inode_operations
duplicating in file.c:
	yfs_file_inode_operations
duplicating in inode.c:
	yfs_symlink_inode_operations
duplicating in mntpt.c:
	yfs_mntpt_inode_operations

pulling it together in inode.c in function "afs_inode_init_from_status"
(because in that function there exists a parameter "afs_operation *op",
which apparently knows about the cell-type OpenAFS/YFS)

               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;

and the same for the other "*_inode_operations" that have a duplication
because of afs_listxattr.

It seems to work for me, tested with

getfattr -d -m - /afs/your-file-system.com
getfattr -d -m - /afs/openafs.org

I also tested in our own cell an yfs cellular-mountpoint via
fs mkm -dir yfs -vol root.cell -cell your-file-system.com

interesting here was, that getfattr on the mountpoint without slash at
the end was listing "our" cell and only afs xattrs, while getfarr on the
mountpoint WITH slash at the end was listing your-file-syste.com as cell
and also the yfs xattrs.

getfattr -d -m - /afs/some.openafs.cell/some/path/yfs
getfattr -d -m - /afs/some.openafs.cell/some/path/yfs/

These two commands gave different results. Trying the same directly in
/afs/<cell> gave the same result, independent of trailing slash or not.

Greetings,
Gaja Peters

-- 
+----------
| IT-Gruppe, Systemadministration
| Universität Hamburg, Fachbereich Mathematik
| Bundesstr. 55 (Geomatikum)
| Raum 212; Tel. 42838-5175
+----------



More information about the linux-afs mailing list