diff options
Diffstat (limited to 'fs/ceph/mds_client.c')
-rw-r--r-- | fs/ceph/mds_client.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c index 885aa5710cfd..b49f12822cbc 100644 --- a/fs/ceph/mds_client.c +++ b/fs/ceph/mds_client.c | |||
@@ -1768,12 +1768,12 @@ int ceph_mdsc_do_request(struct ceph_mds_client *mdsc, | |||
1768 | mutex_unlock(&mdsc->mutex); | 1768 | mutex_unlock(&mdsc->mutex); |
1769 | dout("do_request waiting\n"); | 1769 | dout("do_request waiting\n"); |
1770 | if (req->r_timeout) { | 1770 | if (req->r_timeout) { |
1771 | err = (long)wait_for_completion_interruptible_timeout( | 1771 | err = (long)wait_for_completion_killable_timeout( |
1772 | &req->r_completion, req->r_timeout); | 1772 | &req->r_completion, req->r_timeout); |
1773 | if (err == 0) | 1773 | if (err == 0) |
1774 | err = -EIO; | 1774 | err = -EIO; |
1775 | } else { | 1775 | } else { |
1776 | err = wait_for_completion_interruptible(&req->r_completion); | 1776 | err = wait_for_completion_killable(&req->r_completion); |
1777 | } | 1777 | } |
1778 | dout("do_request waited, got %d\n", err); | 1778 | dout("do_request waited, got %d\n", err); |
1779 | mutex_lock(&mdsc->mutex); | 1779 | mutex_lock(&mdsc->mutex); |
@@ -2014,16 +2014,21 @@ static void handle_forward(struct ceph_mds_client *mdsc, | |||
2014 | mutex_lock(&mdsc->mutex); | 2014 | mutex_lock(&mdsc->mutex); |
2015 | req = __lookup_request(mdsc, tid); | 2015 | req = __lookup_request(mdsc, tid); |
2016 | if (!req) { | 2016 | if (!req) { |
2017 | dout("forward %llu to mds%d - req dne\n", tid, next_mds); | 2017 | dout("forward tid %llu to mds%d - req dne\n", tid, next_mds); |
2018 | goto out; /* dup reply? */ | 2018 | goto out; /* dup reply? */ |
2019 | } | 2019 | } |
2020 | 2020 | ||
2021 | if (fwd_seq <= req->r_num_fwd) { | 2021 | if (req->r_aborted) { |
2022 | dout("forward %llu to mds%d - old seq %d <= %d\n", | 2022 | dout("forward tid %llu aborted, unregistering\n", tid); |
2023 | __unregister_request(mdsc, req); | ||
2024 | } else if (fwd_seq <= req->r_num_fwd) { | ||
2025 | dout("forward tid %llu to mds%d - old seq %d <= %d\n", | ||
2023 | tid, next_mds, req->r_num_fwd, fwd_seq); | 2026 | tid, next_mds, req->r_num_fwd, fwd_seq); |
2024 | } else { | 2027 | } else { |
2025 | /* resend. forward race not possible; mds would drop */ | 2028 | /* resend. forward race not possible; mds would drop */ |
2026 | dout("forward %llu to mds%d (we resend)\n", tid, next_mds); | 2029 | dout("forward tid %llu to mds%d (we resend)\n", tid, next_mds); |
2030 | BUG_ON(req->r_err); | ||
2031 | BUG_ON(req->r_got_result); | ||
2027 | req->r_num_fwd = fwd_seq; | 2032 | req->r_num_fwd = fwd_seq; |
2028 | req->r_resend_mds = next_mds; | 2033 | req->r_resend_mds = next_mds; |
2029 | put_request_session(req); | 2034 | put_request_session(req); |
@@ -2541,7 +2546,7 @@ void ceph_mdsc_lease_send_msg(struct ceph_mds_session *session, | |||
2541 | return; | 2546 | return; |
2542 | lease = msg->front.iov_base; | 2547 | lease = msg->front.iov_base; |
2543 | lease->action = action; | 2548 | lease->action = action; |
2544 | lease->mask = cpu_to_le16(CEPH_LOCK_DN); | 2549 | lease->mask = cpu_to_le16(1); |
2545 | lease->ino = cpu_to_le64(ceph_vino(inode).ino); | 2550 | lease->ino = cpu_to_le64(ceph_vino(inode).ino); |
2546 | lease->first = lease->last = cpu_to_le64(ceph_vino(inode).snap); | 2551 | lease->first = lease->last = cpu_to_le64(ceph_vino(inode).snap); |
2547 | lease->seq = cpu_to_le32(seq); | 2552 | lease->seq = cpu_to_le32(seq); |
@@ -2571,7 +2576,7 @@ void ceph_mdsc_lease_release(struct ceph_mds_client *mdsc, struct inode *inode, | |||
2571 | 2576 | ||
2572 | BUG_ON(inode == NULL); | 2577 | BUG_ON(inode == NULL); |
2573 | BUG_ON(dentry == NULL); | 2578 | BUG_ON(dentry == NULL); |
2574 | BUG_ON(mask != CEPH_LOCK_DN); | 2579 | BUG_ON(mask == 0); |
2575 | 2580 | ||
2576 | /* is dentry lease valid? */ | 2581 | /* is dentry lease valid? */ |
2577 | spin_lock(&dentry->d_lock); | 2582 | spin_lock(&dentry->d_lock); |