Otherwise, someone could potentially query for just CEPH_STATX_VERSION,
and see it as unchanged, even when there are changes buffered up on
other clients.
By doing this, I don't think we'll incur any perf hit in the common use
case which is ganesha querying for all attributes. We are adding Xs
here, but unless there is a lot of xattr activity I don't think that
will generally cause a lot of exclusive cap recalls.
Also, we don't actually need AUTH caps to fetch CEPH_STATX_RDEV, remove
that from statx_to_mask. PIN is sufficient there.
Signed-off-by: Jeff Layton <jlayton@redhat.com>
/* Always set PIN to distinguish from AT_NO_ATTR_SYNC case */
mask |= CEPH_CAP_PIN;
- if (want & (CEPH_STATX_MODE|CEPH_STATX_UID|CEPH_STATX_GID|CEPH_STATX_RDEV|CEPH_STATX_BTIME))
+ if (want & (CEPH_STATX_MODE|CEPH_STATX_UID|CEPH_STATX_GID|CEPH_STATX_BTIME|CEPH_STATX_VERSION))
mask |= CEPH_CAP_AUTH_SHARED;
- if (want & CEPH_STATX_NLINK)
+ if (want & CEPH_STATX_NLINK|CEPH_STATX_VERSION)
mask |= CEPH_CAP_LINK_SHARED;
if (want & (CEPH_STATX_ATIME|CEPH_STATX_MTIME|CEPH_STATX_CTIME|CEPH_STATX_SIZE|CEPH_STATX_BLOCKS|CEPH_STATX_VERSION))
mask |= CEPH_CAP_FILE_SHARED;
-
+ if (want & CEPH_STATX_VERSION)
+ mask |= CEPH_CAP_XATTR_SHARED;
out:
return mask;
}