* [RFC PATCH] ceph: fix statx AT_STATX_DONT_SYNC vs AT_STATX_FORCE_SYNC check
@ 2022-04-11 2:12 xiubli
2022-04-11 9:43 ` David Howells
0 siblings, 1 reply; 3+ messages in thread
From: xiubli @ 2022-04-11 2:12 UTC (permalink / raw)
To: jlayton; +Cc: idryomov, vshankar, dhowells, ceph-devel, Xiubo Li
From: Xiubo Li <xiubli@redhat.com>
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.
Signed-off-by: Xiubo Li <xiubli@redhat.com>
---
fs/ceph/inode.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c
index 6788a1f88eb6..1ee6685def83 100644
--- a/fs/ceph/inode.c
+++ b/fs/ceph/inode.c
@@ -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);
--
2.27.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [RFC PATCH] ceph: fix statx AT_STATX_DONT_SYNC vs AT_STATX_FORCE_SYNC check
2022-04-11 2:12 [RFC PATCH] ceph: fix statx AT_STATX_DONT_SYNC vs AT_STATX_FORCE_SYNC check xiubli
@ 2022-04-11 9:43 ` David Howells
2022-04-11 9:47 ` Xiubo Li
0 siblings, 1 reply; 3+ messages in thread
From: David Howells @ 2022-04-11 9:43 UTC (permalink / raw)
To: xiubli; +Cc: dhowells, jlayton, idryomov, vshankar, ceph-devel
xiubli@redhat.com wrote:
> 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.
They're not flags. It's an enumeration overlain on the at_flags parameter
because syscalls have a limited number of parameters.
> 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.
>
> Signed-off-by: Xiubo Li <xiubli@redhat.com>
Reviewed-by: David Howells <dhowells@redhat.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [RFC PATCH] ceph: fix statx AT_STATX_DONT_SYNC vs AT_STATX_FORCE_SYNC check
2022-04-11 9:43 ` David Howells
@ 2022-04-11 9:47 ` Xiubo Li
0 siblings, 0 replies; 3+ messages in thread
From: Xiubo Li @ 2022-04-11 9:47 UTC (permalink / raw)
To: David Howells; +Cc: jlayton, idryomov, vshankar, ceph-devel
On 4/11/22 5:43 PM, David Howells wrote:
> xiubli@redhat.com wrote:
>
>> 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.
> They're not flags. It's an enumeration overlain on the at_flags parameter
> because syscalls have a limited number of parameters.
Okay, will fix this.
>> 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.
>>
>> Signed-off-by: Xiubo Li <xiubli@redhat.com>
> Reviewed-by: David Howells <dhowells@redhat.com>
Thanks David.
-- Xiubo
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-04-11 9:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-11 2:12 [RFC PATCH] ceph: fix statx AT_STATX_DONT_SYNC vs AT_STATX_FORCE_SYNC check xiubli
2022-04-11 9:43 ` David Howells
2022-04-11 9:47 ` Xiubo Li
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.