diff options
author | Yehuda Sadeh <yehuda@hq.newdream.net> | 2010-07-27 16:11:08 -0400 |
---|---|---|
committer | Sage Weil <sage@newdream.net> | 2010-07-27 16:11:17 -0400 |
commit | 03066f23452ff088ad8e2c8acdf4443043f35b51 (patch) | |
tree | 37f03df4e28de87339cec3b88e479073c8cee958 /fs | |
parent | 25848b3ec681c7018e3746dd850c1e8ed0a3dd6b (diff) |
ceph: use complete_all and wake_up_all
This fixes an issue triggered by running concurrent syncs. One of the syncs
would go through while the other would just hang indefinitely. In any case, we
never actually want to wake a single waiter, so the *_all functions should
be used.
Signed-off-by: Yehuda Sadeh <yehuda@hq.newdream.net>
Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ceph/caps.c | 14 | ||||
-rw-r--r-- | fs/ceph/file.c | 2 | ||||
-rw-r--r-- | fs/ceph/inode.c | 2 | ||||
-rw-r--r-- | fs/ceph/mds_client.c | 10 | ||||
-rw-r--r-- | fs/ceph/mon_client.c | 6 | ||||
-rw-r--r-- | fs/ceph/osd_client.c | 6 |
6 files changed, 20 insertions, 20 deletions
diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c index 6afc1affb50a..b81be9a56487 100644 --- a/fs/ceph/caps.c +++ b/fs/ceph/caps.c | |||
@@ -627,7 +627,7 @@ retry: | |||
627 | if (fmode >= 0) | 627 | if (fmode >= 0) |
628 | __ceph_get_fmode(ci, fmode); | 628 | __ceph_get_fmode(ci, fmode); |
629 | spin_unlock(&inode->i_lock); | 629 | spin_unlock(&inode->i_lock); |
630 | wake_up(&ci->i_cap_wq); | 630 | wake_up_all(&ci->i_cap_wq); |
631 | return 0; | 631 | return 0; |
632 | } | 632 | } |
633 | 633 | ||
@@ -1181,7 +1181,7 @@ static int __send_cap(struct ceph_mds_client *mdsc, struct ceph_cap *cap, | |||
1181 | } | 1181 | } |
1182 | 1182 | ||
1183 | if (wake) | 1183 | if (wake) |
1184 | wake_up(&ci->i_cap_wq); | 1184 | wake_up_all(&ci->i_cap_wq); |
1185 | 1185 | ||
1186 | return delayed; | 1186 | return delayed; |
1187 | } | 1187 | } |
@@ -2153,7 +2153,7 @@ void ceph_put_cap_refs(struct ceph_inode_info *ci, int had) | |||
2153 | else if (flushsnaps) | 2153 | else if (flushsnaps) |
2154 | ceph_flush_snaps(ci); | 2154 | ceph_flush_snaps(ci); |
2155 | if (wake) | 2155 | if (wake) |
2156 | wake_up(&ci->i_cap_wq); | 2156 | wake_up_all(&ci->i_cap_wq); |
2157 | if (put) | 2157 | if (put) |
2158 | iput(inode); | 2158 | iput(inode); |
2159 | } | 2159 | } |
@@ -2229,7 +2229,7 @@ void ceph_put_wrbuffer_cap_refs(struct ceph_inode_info *ci, int nr, | |||
2229 | iput(inode); | 2229 | iput(inode); |
2230 | } else if (complete_capsnap) { | 2230 | } else if (complete_capsnap) { |
2231 | ceph_flush_snaps(ci); | 2231 | ceph_flush_snaps(ci); |
2232 | wake_up(&ci->i_cap_wq); | 2232 | wake_up_all(&ci->i_cap_wq); |
2233 | } | 2233 | } |
2234 | if (drop_capsnap) | 2234 | if (drop_capsnap) |
2235 | iput(inode); | 2235 | iput(inode); |
@@ -2405,7 +2405,7 @@ static void handle_cap_grant(struct inode *inode, struct ceph_mds_caps *grant, | |||
2405 | if (queue_invalidate) | 2405 | if (queue_invalidate) |
2406 | ceph_queue_invalidate(inode); | 2406 | ceph_queue_invalidate(inode); |
2407 | if (wake) | 2407 | if (wake) |
2408 | wake_up(&ci->i_cap_wq); | 2408 | wake_up_all(&ci->i_cap_wq); |
2409 | 2409 | ||
2410 | if (check_caps == 1) | 2410 | if (check_caps == 1) |
2411 | ceph_check_caps(ci, CHECK_CAPS_NODELAY|CHECK_CAPS_AUTHONLY, | 2411 | ceph_check_caps(ci, CHECK_CAPS_NODELAY|CHECK_CAPS_AUTHONLY, |
@@ -2460,7 +2460,7 @@ static void handle_cap_flush_ack(struct inode *inode, u64 flush_tid, | |||
2460 | struct ceph_inode_info, | 2460 | struct ceph_inode_info, |
2461 | i_flushing_item)->vfs_inode); | 2461 | i_flushing_item)->vfs_inode); |
2462 | mdsc->num_cap_flushing--; | 2462 | mdsc->num_cap_flushing--; |
2463 | wake_up(&mdsc->cap_flushing_wq); | 2463 | wake_up_all(&mdsc->cap_flushing_wq); |
2464 | dout(" inode %p now !flushing\n", inode); | 2464 | dout(" inode %p now !flushing\n", inode); |
2465 | 2465 | ||
2466 | if (ci->i_dirty_caps == 0) { | 2466 | if (ci->i_dirty_caps == 0) { |
@@ -2472,7 +2472,7 @@ static void handle_cap_flush_ack(struct inode *inode, u64 flush_tid, | |||
2472 | } | 2472 | } |
2473 | } | 2473 | } |
2474 | spin_unlock(&mdsc->cap_dirty_lock); | 2474 | spin_unlock(&mdsc->cap_dirty_lock); |
2475 | wake_up(&ci->i_cap_wq); | 2475 | wake_up_all(&ci->i_cap_wq); |
2476 | 2476 | ||
2477 | out: | 2477 | out: |
2478 | spin_unlock(&inode->i_lock); | 2478 | spin_unlock(&inode->i_lock); |
diff --git a/fs/ceph/file.c b/fs/ceph/file.c index 6251a1574b94..7c08698fad3e 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/file.c | |||
@@ -265,7 +265,7 @@ int ceph_release(struct inode *inode, struct file *file) | |||
265 | kmem_cache_free(ceph_file_cachep, cf); | 265 | kmem_cache_free(ceph_file_cachep, cf); |
266 | 266 | ||
267 | /* wake up anyone waiting for caps on this inode */ | 267 | /* wake up anyone waiting for caps on this inode */ |
268 | wake_up(&ci->i_cap_wq); | 268 | wake_up_all(&ci->i_cap_wq); |
269 | return 0; | 269 | return 0; |
270 | } | 270 | } |
271 | 271 | ||
diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c index 3582e79f46e0..389f9dbd9949 100644 --- a/fs/ceph/inode.c +++ b/fs/ceph/inode.c | |||
@@ -1501,7 +1501,7 @@ retry: | |||
1501 | if (wrbuffer_refs == 0) | 1501 | if (wrbuffer_refs == 0) |
1502 | ceph_check_caps(ci, CHECK_CAPS_AUTHONLY, NULL); | 1502 | ceph_check_caps(ci, CHECK_CAPS_AUTHONLY, NULL); |
1503 | if (wake) | 1503 | if (wake) |
1504 | wake_up(&ci->i_cap_wq); | 1504 | wake_up_all(&ci->i_cap_wq); |
1505 | } | 1505 | } |
1506 | 1506 | ||
1507 | 1507 | ||
diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c index 416c08d315db..dd440bd438a9 100644 --- a/fs/ceph/mds_client.c +++ b/fs/ceph/mds_client.c | |||
@@ -868,7 +868,7 @@ static int wake_up_session_cb(struct inode *inode, struct ceph_cap *cap, | |||
868 | { | 868 | { |
869 | struct ceph_inode_info *ci = ceph_inode(inode); | 869 | struct ceph_inode_info *ci = ceph_inode(inode); |
870 | 870 | ||
871 | wake_up(&ci->i_cap_wq); | 871 | wake_up_all(&ci->i_cap_wq); |
872 | if (arg) { | 872 | if (arg) { |
873 | spin_lock(&inode->i_lock); | 873 | spin_lock(&inode->i_lock); |
874 | ci->i_wanted_max_size = 0; | 874 | ci->i_wanted_max_size = 0; |
@@ -1564,7 +1564,7 @@ static void complete_request(struct ceph_mds_client *mdsc, | |||
1564 | if (req->r_callback) | 1564 | if (req->r_callback) |
1565 | req->r_callback(mdsc, req); | 1565 | req->r_callback(mdsc, req); |
1566 | else | 1566 | else |
1567 | complete(&req->r_completion); | 1567 | complete_all(&req->r_completion); |
1568 | } | 1568 | } |
1569 | 1569 | ||
1570 | /* | 1570 | /* |
@@ -1932,7 +1932,7 @@ static void handle_reply(struct ceph_mds_session *session, struct ceph_msg *msg) | |||
1932 | if (head->safe) { | 1932 | if (head->safe) { |
1933 | req->r_got_safe = true; | 1933 | req->r_got_safe = true; |
1934 | __unregister_request(mdsc, req); | 1934 | __unregister_request(mdsc, req); |
1935 | complete(&req->r_safe_completion); | 1935 | complete_all(&req->r_safe_completion); |
1936 | 1936 | ||
1937 | if (req->r_got_unsafe) { | 1937 | if (req->r_got_unsafe) { |
1938 | /* | 1938 | /* |
@@ -1947,7 +1947,7 @@ static void handle_reply(struct ceph_mds_session *session, struct ceph_msg *msg) | |||
1947 | 1947 | ||
1948 | /* last unsafe request during umount? */ | 1948 | /* last unsafe request during umount? */ |
1949 | if (mdsc->stopping && !__get_oldest_req(mdsc)) | 1949 | if (mdsc->stopping && !__get_oldest_req(mdsc)) |
1950 | complete(&mdsc->safe_umount_waiters); | 1950 | complete_all(&mdsc->safe_umount_waiters); |
1951 | mutex_unlock(&mdsc->mutex); | 1951 | mutex_unlock(&mdsc->mutex); |
1952 | goto out; | 1952 | goto out; |
1953 | } | 1953 | } |
@@ -2126,7 +2126,7 @@ static void handle_session(struct ceph_mds_session *session, | |||
2126 | pr_info("mds%d reconnect denied\n", session->s_mds); | 2126 | pr_info("mds%d reconnect denied\n", session->s_mds); |
2127 | remove_session_caps(session); | 2127 | remove_session_caps(session); |
2128 | wake = 1; /* for good measure */ | 2128 | wake = 1; /* for good measure */ |
2129 | complete(&mdsc->session_close_waiters); | 2129 | complete_all(&mdsc->session_close_waiters); |
2130 | kick_requests(mdsc, mds); | 2130 | kick_requests(mdsc, mds); |
2131 | break; | 2131 | break; |
2132 | 2132 | ||
diff --git a/fs/ceph/mon_client.c b/fs/ceph/mon_client.c index cc115eafae11..54fe01c50706 100644 --- a/fs/ceph/mon_client.c +++ b/fs/ceph/mon_client.c | |||
@@ -345,7 +345,7 @@ static void ceph_monc_handle_map(struct ceph_mon_client *monc, | |||
345 | 345 | ||
346 | out: | 346 | out: |
347 | mutex_unlock(&monc->mutex); | 347 | mutex_unlock(&monc->mutex); |
348 | wake_up(&client->auth_wq); | 348 | wake_up_all(&client->auth_wq); |
349 | } | 349 | } |
350 | 350 | ||
351 | /* | 351 | /* |
@@ -462,7 +462,7 @@ static void handle_statfs_reply(struct ceph_mon_client *monc, | |||
462 | } | 462 | } |
463 | mutex_unlock(&monc->mutex); | 463 | mutex_unlock(&monc->mutex); |
464 | if (req) { | 464 | if (req) { |
465 | complete(&req->completion); | 465 | complete_all(&req->completion); |
466 | put_generic_request(req); | 466 | put_generic_request(req); |
467 | } | 467 | } |
468 | return; | 468 | return; |
@@ -718,7 +718,7 @@ static void handle_auth_reply(struct ceph_mon_client *monc, | |||
718 | monc->m_auth->front_max); | 718 | monc->m_auth->front_max); |
719 | if (ret < 0) { | 719 | if (ret < 0) { |
720 | monc->client->auth_err = ret; | 720 | monc->client->auth_err = ret; |
721 | wake_up(&monc->client->auth_wq); | 721 | wake_up_all(&monc->client->auth_wq); |
722 | } else if (ret > 0) { | 722 | } else if (ret > 0) { |
723 | __send_prepared_auth_request(monc, ret); | 723 | __send_prepared_auth_request(monc, ret); |
724 | } else if (!was_auth && monc->auth->ops->is_authenticated(monc->auth)) { | 724 | } else if (!was_auth && monc->auth->ops->is_authenticated(monc->auth)) { |
diff --git a/fs/ceph/osd_client.c b/fs/ceph/osd_client.c index 92b7251a53f1..e38522347898 100644 --- a/fs/ceph/osd_client.c +++ b/fs/ceph/osd_client.c | |||
@@ -862,12 +862,12 @@ static void handle_reply(struct ceph_osd_client *osdc, struct ceph_msg *msg, | |||
862 | if (req->r_callback) | 862 | if (req->r_callback) |
863 | req->r_callback(req, msg); | 863 | req->r_callback(req, msg); |
864 | else | 864 | else |
865 | complete(&req->r_completion); | 865 | complete_all(&req->r_completion); |
866 | 866 | ||
867 | if (flags & CEPH_OSD_FLAG_ONDISK) { | 867 | if (flags & CEPH_OSD_FLAG_ONDISK) { |
868 | if (req->r_safe_callback) | 868 | if (req->r_safe_callback) |
869 | req->r_safe_callback(req, msg); | 869 | req->r_safe_callback(req, msg); |
870 | complete(&req->r_safe_completion); /* fsync waiter */ | 870 | complete_all(&req->r_safe_completion); /* fsync waiter */ |
871 | } | 871 | } |
872 | 872 | ||
873 | done: | 873 | done: |
@@ -1083,7 +1083,7 @@ done: | |||
1083 | if (newmap) | 1083 | if (newmap) |
1084 | kick_requests(osdc, NULL); | 1084 | kick_requests(osdc, NULL); |
1085 | up_read(&osdc->map_sem); | 1085 | up_read(&osdc->map_sem); |
1086 | wake_up(&osdc->client->auth_wq); | 1086 | wake_up_all(&osdc->client->auth_wq); |
1087 | return; | 1087 | return; |
1088 | 1088 | ||
1089 | bad: | 1089 | bad: |