ceph: fix statx AT_STATX_DONT_SYNC vs AT_STATX_FORCE_SYNC check
RFC PATCH 1/1 ceph: fix statx AT_STATX_DONT_SYNC vs AT_STATX_FORCE_SYNC check
From: Xiubo Li <[email protected]>
From the posix and the initial statx supporting commit comments, the AT_STATX_DONT_SYNC is a lightweight stat flag 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.
--- fs/ceph/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ceph/inode.c +1 -1
@@ -2887,7 +2887,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 );
Signature · 1 line
2.27.0
Quoted 3 lines · [email protected] wrote:
From the posix and the initial statx supporting commit comments, the
AT_STATX_DONT_SYNCis a lightweight stat flag and theAT_STATX_FORCE_SYNCis a heaverweight one.
They're not flags. It's an enumeration overlain on the at_flags parameter because syscalls have a limited number of parameters.
Quoted 7 lines
And also checked all
the other current usage about these two flags they are all doing the same, that is only when theAT_STATX_FORCE_SYNCis not set and theAT_STATX_DONT_SYNCis set will they skip sync retriving the attributes from storage.Signed-off-by Xiubo Li <[email protected]>
Quoted 7 lines · David Howells
Quoted 3 lines · [email protected] wrote:
From the posix and the initial statx supporting commit comments,
theAT_STATX_DONT_SYNCis a lightweight stat flag and theAT_STATX_FORCE_SYNCis a heaverweight one.They're not flags. It's an enumeration overlain on the
at_flagsparameter because syscalls have a limited number of parameters.
Okay, will fix this.
Quoted 8 lines
Quoted 7 lines
And also checked all
the other current usage about these two flags they are all doing the same, that is only when theAT_STATX_FORCE_SYNCis not set and theAT_STATX_DONT_SYNCis set will they skip sync retriving the attributes from storage.Signed-off-by Xiubo Li <[email protected]>Reviewed-by David Howells <[email protected]>
Thanks David.
-- Xiubo