summaryrefslogtreecommitdiff
path: root/fs/ceph/caps.c
diff options
context:
space:
mode:
authorYan, Zheng <zyan@redhat.com>2016-12-22 11:05:43 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-01-26 10:24:43 +0300
commit8934e069674a09c4ce4a0858e1aee5474784df92 (patch)
tree56a16108b9b39f7b8a2abddac97f52a98bcdb885 /fs/ceph/caps.c
parent48baa924108e124bc5221ca73b72562a8479c11c (diff)
downloadlinux-8934e069674a09c4ce4a0858e1aee5474784df92.tar.xz
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/ceph/caps.c')
-rw-r--r--fs/ceph/caps.c7
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,
add_wait_queue(&ci->i_cap_wq, &wait);
while (!try_get_cap_refs(ci, need, want, endoff,
- true, &_got, &err))
+ true, &_got, &err)) {
+ if (signal_pending(current)) {
+ ret = -ERESTARTSYS;
+ break;
+ }
wait_woken(&wait, TASK_INTERRUPTIBLE, MAX_SCHEDULE_TIMEOUT);
+ }
remove_wait_queue(&ci->i_cap_wq, &wait);