[PATCH] afs: Fix afs_listxattr() to not list YFS xattrs if a non-YFS server is seen

Gaja Sophie Peters gaja.peters at math.uni-hamburg.de
Tue Mar 9 10:59:35 GMT 2021


Am 08.03.21 um 22:55 schrieb David Howells:

this patch leads to the code:
>                if (op->server->type == AFS_SERVER_TYPE_YFS &&
>                     op->ops->issue_yfs_rpc)
>                         op->ops->issue_yfs_rpc(op);
>                 else if (op->server->type == AFS_SERVER_TYPE_AFS &&
>                          op->ops->issue_afs_rpc)
>                         op->ops->issue_afs_rpc(op);
>                 else
>                         op->ac.error = -ENOTSUPP;

In an earlier email you wrote,

> 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.

If I understand both of these together correctly, it would mean, that
before the server is probed and while server->type is unset, the
afs_operation wouldn't be executed at all?

Maybe because of that, or because of some other reason (I am not sure),
I get now an "unknown error 524" with "afs.acl", when querying an
yfs-server. Oh - and when querying an yfs-server the first time, I get
only the afs-xattrs, when qerying a few seconds later again, I get also
the yfs xattrs:

$ LC_ALL=C getfattr -d -m - afs/your-file-system.com/
afs/your-file-system.com/: afs.acl: Unknown error 524
# file: afs/your-file-system.com/
afs.cell="your-file-system.com"
afs.fid="200005c4:1:1"
afs.volume="root.cell"

$ LC_ALL=C getfattr -d -m - afs/your-file-system.com/
afs/your-file-system.com/: afs.acl: Unknown error 524
# file: afs/your-file-system.com/
afs.cell="your-file-system.com"
afs.fid="200005c4:1:1"
afs.volume="root.cell"
afs.yfs.acl=0sAAAAAwAAAAAAAAABAAAAFXN5c3RlbTphZG1pbmlzdHJhdG9ycwAAAAAAAAAAAAB/AAAAAQAAAA5zeXN0ZW06YW55dXNlcgAAAAAAAAAAAAgAAAABAAAAD3N5c3RlbTphdXRodXNlcgAAAAAAAAAACQ==
afs.yfs.acl_inherited="0"
afs.yfs.acl_num_cleaned="0"
afs.yfs.vol_acl=""


And yes, it might be because of unset server-type? strace tells me:

listxattr("afs/your-file-system.com/",
"afs.acl\0afs.cell\0afs.fid\0afs.vol"..., 256) = 110
getxattr("afs/your-file-system.com/", "afs.acl", NULL, 0) = -1 ENOTSUPP
(Unknown error 524)

Interestingly, even after the afs.yfs.* xattrs are listed, the error 524
remains – but only for afs.acl, all other attributes work.


With the "other" patch (posted by me in
http://lists.infradead.org/pipermail/linux-afs/2021-March/003512.htm)
both problems did not occur, there was no error 524 and the afs.yfs.*
attrs were shown in the first getfattr call.

Not sure what to make of it. ;)
The best way might really be to not list the special xattrs at all.

Greetings,
Gaja

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







More information about the linux-afs mailing list