]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds/Locker: remove session check access when doing cap updates
authorRamana Raja <rraja@redhat.com>
Fri, 29 Jul 2022 21:51:14 +0000 (17:51 -0400)
committerXiubo Li <xiubli@redhat.com>
Wed, 27 Mar 2024 00:42:41 +0000 (08:42 +0800)
as it's too late. Session access authorization already happens
before new caps are issued.

Fixes: https://tracker.ceph.com/issues/56067
Signed-off-by: Ramana Raja <rraja@redhat.com>
(cherry picked from commit 96305b5eef06e2b379ed95a086edf9e4809a7e70)

src/mds/Locker.cc

index 3406b0e01716e0efe1fc3a1079694cfc3a265031..d156155b5f8123506a7dd3f2ee87ebb0a4edadd4 100644 (file)
@@ -3920,13 +3920,6 @@ bool Locker::_do_cap_update(CInode *in, Capability *cap,
   if (!dirty && !change_max)
     return false;
 
-  Session *session = mds->get_session(m);
-  if (session->check_access(in, MAY_WRITE,
-                           m->caller_uid, m->caller_gid, NULL, 0, 0) < 0) {
-    dout(10) << "check_access failed, dropping cap update on " << *in << dendl;
-    return false;
-  }
-
   // do the update.
   EUpdate *le = new EUpdate(mds->mdlog, "cap update");
   mds->mdlog->start_entry(le);