summaryrefslogtreecommitdiff
path: root/fs/ceph/mds_client.c
diff options
context:
space:
mode:
authorYan, Zheng <zyan@redhat.com>2014-10-14 10:33:35 +0800
committerIlya Dryomov <idryomov@redhat.com>2014-12-17 20:09:49 +0300
commit9280be24dc9c7aaee230de3ed33f8357386de9a2 (patch)
tree5ff0cf8f4326a05d72d8aef60b75ab631af07bc9 /fs/ceph/mds_client.c
parentb2776bf7149bddd1f4161f14f79520f17fc1d71d (diff)
downloadlwn-9280be24dc9c7aaee230de3ed33f8357386de9a2.tar.gz
lwn-9280be24dc9c7aaee230de3ed33f8357386de9a2.zip
ceph: fix file lock interruption
When a lock operation is interrupted, current code sends a unlock request to MDS to undo the lock operation. This method does not work as expected because the unlock request can drop locks that have already been acquired. The fix is use the newly introduced CEPH_LOCK_FCNTL_INTR/CEPH_LOCK_FLOCK_INTR requests to interrupt blocked file lock request. These requests do not drop locks that have alread been acquired, they only interrupt blocked file lock request. Signed-off-by: Yan, Zheng <zyan@redhat.com>
Diffstat (limited to 'fs/ceph/mds_client.c')
-rw-r--r--fs/ceph/mds_client.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
index a92d3f5c6c12..5a47ed760e6d 100644
--- a/fs/ceph/mds_client.c
+++ b/fs/ceph/mds_client.c
@@ -2208,6 +2208,8 @@ int ceph_mdsc_do_request(struct ceph_mds_client *mdsc,
&req->r_completion, req->r_timeout);
if (err == 0)
err = -EIO;
+ } else if (req->r_wait_for_completion) {
+ err = req->r_wait_for_completion(mdsc, req);
} else {
err = wait_for_completion_killable(&req->r_completion);
}