From: Xiubo Li Date: Mon, 11 Apr 2022 01:59:09 +0000 (+0800) Subject: ceph: fix statx AT_STATX_DONT_SYNC vs AT_STATX_FORCE_SYNC check X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c6053ac9e1f04475ed63e940f32f599aa4581b8e;p=ceph-client.git ceph: fix statx AT_STATX_DONT_SYNC vs AT_STATX_FORCE_SYNC check From the posix and the initial statx supporting commit comments, the AT_STATX_DONT_SYNC is a lightweight stat and the AT_STATX_FORCE_SYNC is a heaverweight one. And also checked all the other current usage about these two flags they are all doing the same, that is only when the AT_STATX_FORCE_SYNC is not set and the AT_STATX_DONT_SYNC is set will they skip sync retriving the attributes from storage. Reviewed-by: David Howells Signed-off-by: Xiubo Li --- diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c index f734dfe81675..b45f321910af 100644 --- a/fs/ceph/inode.c +++ b/fs/ceph/inode.c @@ -2425,7 +2425,7 @@ int ceph_getattr(struct user_namespace *mnt_userns, const struct path *path, return -ESTALE; /* Skip the getattr altogether if we're asked not to sync */ - if (!(flags & AT_STATX_DONT_SYNC)) { + if ((flags & AT_STATX_SYNC_TYPE) != AT_STATX_DONT_SYNC) { err = ceph_do_getattr(inode, statx_to_caps(request_mask, inode->i_mode), flags & AT_STATX_FORCE_SYNC);