diff options
| -rw-r--r-- | fs/io_uring.c | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c index 9cc7a101ef2a..383d208ca0d2 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c | |||
| @@ -2181,7 +2181,6 @@ static int io_cqring_wait(struct io_ring_ctx *ctx, int min_events, | |||
| 2181 | { | 2181 | { |
| 2182 | struct io_cq_ring *ring = ctx->cq_ring; | 2182 | struct io_cq_ring *ring = ctx->cq_ring; |
| 2183 | sigset_t ksigmask, sigsaved; | 2183 | sigset_t ksigmask, sigsaved; |
| 2184 | DEFINE_WAIT(wait); | ||
| 2185 | int ret; | 2184 | int ret; |
| 2186 | 2185 | ||
| 2187 | if (io_cqring_events(ring) >= min_events) | 2186 | if (io_cqring_events(ring) >= min_events) |
| @@ -2201,21 +2200,9 @@ static int io_cqring_wait(struct io_ring_ctx *ctx, int min_events, | |||
| 2201 | return ret; | 2200 | return ret; |
| 2202 | } | 2201 | } |
| 2203 | 2202 | ||
| 2204 | do { | 2203 | ret = wait_event_interruptible(ctx->wait, io_cqring_events(ring) >= min_events); |
| 2205 | prepare_to_wait(&ctx->wait, &wait, TASK_INTERRUPTIBLE); | 2204 | if (ret == -ERESTARTSYS) |
| 2206 | |||
| 2207 | ret = 0; | ||
| 2208 | if (io_cqring_events(ring) >= min_events) | ||
| 2209 | break; | ||
| 2210 | |||
| 2211 | schedule(); | ||
| 2212 | |||
| 2213 | ret = -EINTR; | 2205 | ret = -EINTR; |
| 2214 | if (signal_pending(current)) | ||
| 2215 | break; | ||
| 2216 | } while (1); | ||
| 2217 | |||
| 2218 | finish_wait(&ctx->wait, &wait); | ||
| 2219 | 2206 | ||
| 2220 | if (sig) | 2207 | if (sig) |
| 2221 | restore_user_sigmask(sig, &sigsaved); | 2208 | restore_user_sigmask(sig, &sigsaved); |
