Bug #17522
closedceph_readdirplus_r does not acquire caps before sending back attributes
100%
Description
In order to send a reliable set of attributes back to the caller, cephfs should ensure that the client has shared caps for all types. When handling a readdirplus however, the client code does not do this. It will gather shared caps for the directory, but the stat structs are generally filled out with whatever is in the cache.
I think (but am not sure) that exclusive caps on the entries are recalled by the MDS before satisfying a readdir request on the wire, so the problem of stale attributes is limited to entries that are satisfied out of the cache.
AFAICT, only a few internal callers and ganesha use ceph_readdirplus_r, so the impact here is pretty minimal so far. Still, it's probably
worth fixing.
I have a patchset in progress to clean this up in conjunction with the conversion to ceph_statx.