ceph: only touch the caps which have the subset mask requested
authorXiubo Li <xiubli@redhat.com>
Mon, 16 Dec 2019 05:12:07 +0000 (00:12 -0500)
committerIlya Dryomov <idryomov@gmail.com>
Mon, 27 Jan 2020 15:53:39 +0000 (16:53 +0100)
For the caps having no any subset mask requested we shouldn't touch
them.

Signed-off-by: Xiubo Li <xiubli@redhat.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
fs/ceph/caps.c

index 9d09bb5..28ae0c1 100644 (file)
@@ -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;