It doesn't make sense that
open("file", O_CREAT|...)
will acquire a readlock on the file's snaplock when the file already
exists, but:
open("file", ...)
will not.
Fixes: https://tracker.ceph.com/issues/62058
Fixes: c1d7f93d7bd06d773b8035359548c0c9216398e3
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
(cherry picked from commit
c04ab6f0868a7385e695c85486cf3e7bbdfa9ab5)
}
MutationImpl::LockOpVec lov;
+ lov.add_rdlock(&cur->snaplock);
unsigned mask = req->head.args.open.mask;
if (mask) {
// it existed.
ceph_assert(mdr.get()->is_rdlocked(&dn->lock));
- MutationImpl::LockOpVec lov;
- lov.add_rdlock(&dnl->get_inode()->snaplock);
- if (!mds->locker->acquire_locks(mdr, lov))
- return;
-
handle_client_open(mdr);
return;
}