mirror of
https://github.com/ceph/ceph
synced 2024-12-30 15:33:31 +00:00
mds: fix O_TRUNC locking
When truncating a file, we should xlock the corresponding filelock. (revoke any Fw caps from clients). [note from sw: setattr on size also takes the filelock xlock.] Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com> Reviewed-by: Sage Weil <sage@inktank.com>
This commit is contained in:
parent
cd44a62371
commit
4fb782c38c
@ -2437,7 +2437,7 @@ void Server::handle_client_open(MDRequest *mdr)
|
||||
mdr->session->have_completed_request(req->get_reqid().tid, NULL))) {
|
||||
assert(cur->is_auth());
|
||||
|
||||
wrlocks.insert(&cur->filelock);
|
||||
xlocks.insert(&cur->filelock);
|
||||
if (!mds->locker->acquire_locks(mdr, rdlocks, wrlocks, xlocks))
|
||||
return;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user