aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/ceph
diff options
context:
space:
mode:
authorYan, Zheng <zyan@redhat.com>2014-10-13 22:33:35 -0400
committerIlya Dryomov <idryomov@redhat.com>2014-12-17 12:09:49 -0500
commit9280be24dc9c7aaee230de3ed33f8357386de9a2 (patch)
tree5ff0cf8f4326a05d72d8aef60b75ab631af07bc9 /include/linux/ceph
parentb2776bf7149bddd1f4161f14f79520f17fc1d71d (diff)
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 'include/linux/ceph')
-rw-r--r--include/linux/ceph/ceph_fs.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/include/linux/ceph/ceph_fs.h b/include/linux/ceph/ceph_fs.h
index 3c97d5e9b951..31d8b98b7f96 100644
--- a/include/linux/ceph/ceph_fs.h
+++ b/include/linux/ceph/ceph_fs.h
@@ -522,8 +522,11 @@ struct ceph_mds_reply_dirfrag {
522 __le32 dist[]; 522 __le32 dist[];
523} __attribute__ ((packed)); 523} __attribute__ ((packed));
524 524
525#define CEPH_LOCK_FCNTL 1 525#define CEPH_LOCK_FCNTL 1
526#define CEPH_LOCK_FLOCK 2 526#define CEPH_LOCK_FLOCK 2
527#define CEPH_LOCK_FCNTL_INTR 3
528#define CEPH_LOCK_FLOCK_INTR 4
529
527 530
528#define CEPH_LOCK_SHARED 1 531#define CEPH_LOCK_SHARED 1
529#define CEPH_LOCK_EXCL 2 532#define CEPH_LOCK_EXCL 2