diff options
-rw-r--r-- | fs/aio.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -496,7 +496,12 @@ static int aio_setup_ring(struct kioctx *ctx) | |||
496 | ctx->mmap_size = nr_pages * PAGE_SIZE; | 496 | ctx->mmap_size = nr_pages * PAGE_SIZE; |
497 | pr_debug("attempting mmap of %lu bytes\n", ctx->mmap_size); | 497 | pr_debug("attempting mmap of %lu bytes\n", ctx->mmap_size); |
498 | 498 | ||
499 | down_write(&mm->mmap_sem); | 499 | if (down_write_killable(&mm->mmap_sem)) { |
500 | ctx->mmap_size = 0; | ||
501 | aio_free_ring(ctx); | ||
502 | return -EINTR; | ||
503 | } | ||
504 | |||
500 | ctx->mmap_base = do_mmap_pgoff(ctx->aio_ring_file, 0, ctx->mmap_size, | 505 | ctx->mmap_base = do_mmap_pgoff(ctx->aio_ring_file, 0, ctx->mmap_size, |
501 | PROT_READ | PROT_WRITE, | 506 | PROT_READ | PROT_WRITE, |
502 | MAP_SHARED, 0, &unused); | 507 | MAP_SHARED, 0, &unused); |