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:
Yan, Zheng 2013-06-30 07:44:04 +08:00 committed by Sage Weil
parent cd44a62371
commit 4fb782c38c

View File

@ -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;