]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: fix O_TRUNC locking
authorYan, Zheng <zheng.z.yan@intel.com>
Sat, 29 Jun 2013 23:44:04 +0000 (07:44 +0800)
committerSage Weil <sage@inktank.com>
Wed, 3 Jul 2013 18:13:35 +0000 (11:13 -0700)
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>
src/mds/Server.cc

index 627ecd0cdb7389fb0a7809bb3c518778fcf0be4f..38dad1948a457e4c226a455792e2269f1c2f29ee 100644 (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;