diff options
author | Yan, Zheng <zyan@redhat.com> | 2016-12-22 03:05:43 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-01-26 02:24:43 -0500 |
commit | 8934e069674a09c4ce4a0858e1aee5474784df92 (patch) | |
tree | 56a16108b9b39f7b8a2abddac97f52a98bcdb885 /fs | |
parent | 48baa924108e124bc5221ca73b72562a8479c11c (diff) |
ceph: fix ceph_get_caps() interruption
commit 6e09d0fb64402cec579f029ca4c7f39f5c48fc60 upstream.
Commit 5c341ee32881 ("ceph: fix scheduler warning due to nested
blocking") causes infinite loop when process is interrupted. Fix it.
Signed-off-by: Yan, Zheng <zyan@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ceph/caps.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c index 4037b389a7e9..f3f21105b860 100644 --- a/fs/ceph/caps.c +++ b/fs/ceph/caps.c | |||
@@ -2511,8 +2511,13 @@ int ceph_get_caps(struct ceph_inode_info *ci, int need, int want, | |||
2511 | add_wait_queue(&ci->i_cap_wq, &wait); | 2511 | add_wait_queue(&ci->i_cap_wq, &wait); |
2512 | 2512 | ||
2513 | while (!try_get_cap_refs(ci, need, want, endoff, | 2513 | while (!try_get_cap_refs(ci, need, want, endoff, |
2514 | true, &_got, &err)) | 2514 | true, &_got, &err)) { |
2515 | if (signal_pending(current)) { | ||
2516 | ret = -ERESTARTSYS; | ||
2517 | break; | ||
2518 | } | ||
2515 | wait_woken(&wait, TASK_INTERRUPTIBLE, MAX_SCHEDULE_TIMEOUT); | 2519 | wait_woken(&wait, TASK_INTERRUPTIBLE, MAX_SCHEDULE_TIMEOUT); |
2520 | } | ||
2516 | 2521 | ||
2517 | remove_wait_queue(&ci->i_cap_wq, &wait); | 2522 | remove_wait_queue(&ci->i_cap_wq, &wait); |
2518 | 2523 | ||