diff mbox series

ceph: only touch the caps which have the subset mask requested

Message ID 20191216051207.8667-1-xiubli@redhat.com (mailing list archive)
State New, archived
Headers show
Series ceph: only touch the caps which have the subset mask requested | expand

Commit Message

Xiubo Li Dec. 16, 2019, 5:12 a.m. UTC
From: Xiubo Li <xiubli@redhat.com>

For the caps having no any subset mask requested we shouldn't touch
them.

Signed-off-by: Xiubo Li <xiubli@redhat.com>
---
 fs/ceph/caps.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Jeff Layton Dec. 16, 2019, 4:59 p.m. UTC | #1
On Mon, 2019-12-16 at 00:12 -0500, xiubli@redhat.com wrote:
> From: Xiubo Li <xiubli@redhat.com>
> 
> For the caps having no any subset mask requested we shouldn't touch
> them.
> 
> Signed-off-by: Xiubo Li <xiubli@redhat.com>
> ---
>  fs/ceph/caps.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c
> index 1d7f66902b0a..b9e5960df183 100644
> --- a/fs/ceph/caps.c
> +++ b/fs/ceph/caps.c
> @@ -908,7 +908,8 @@ int __ceph_caps_issued_mask(struct ceph_inode_info *ci, int mask, int touch)
>  						       ci_node);
>  					if (!__cap_is_valid(cap))
>  						continue;
> -					__touch_cap(cap);
> +					if (cap->issued & mask)
> +						__touch_cap(cap);
>  				}
>  			}
>  			return 1;

Looks correct to me. Merged.

Thanks,
diff mbox series

Patch

diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c
index 1d7f66902b0a..b9e5960df183 100644
--- a/fs/ceph/caps.c
+++ b/fs/ceph/caps.c
@@ -908,7 +908,8 @@  int __ceph_caps_issued_mask(struct ceph_inode_info *ci, int mask, int touch)
 						       ci_node);
 					if (!__cap_is_valid(cap))
 						continue;
-					__touch_cap(cap);
+					if (cap->issued & mask)
+						__touch_cap(cap);
 				}
 			}
 			return 1;