diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-12-06 17:32:59 +0100 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-12-06 17:32:59 +0100 |
commit | c537aba00e3f1df8ce6c7c9fcb98b82c0c2d1d2c (patch) | |
tree | 487b3ceb33b2903fa03ead519a8459d994f77dc4 /fs | |
parent | Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/... (diff) | |
parent | aio: clean up aio ring in the fail path (diff) | |
download | linux-c537aba00e3f1df8ce6c7c9fcb98b82c0c2d1d2c.tar.xz linux-c537aba00e3f1df8ce6c7c9fcb98b82c0c2d1d2c.zip |
Merge git://git.kvack.org/~bcrl/aio-next
Pull aio fix from Benjamin LaHaise:
"AIO fix from Gu Zheng that fixes a GPF that Dave Jones uncovered with
trinity"
* git://git.kvack.org/~bcrl/aio-next:
aio: clean up aio ring in the fail path
Diffstat (limited to 'fs')
-rw-r--r-- | fs/aio.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -367,8 +367,10 @@ static int aio_setup_ring(struct kioctx *ctx) if (nr_pages > AIO_RING_PAGES) { ctx->ring_pages = kcalloc(nr_pages, sizeof(struct page *), GFP_KERNEL); - if (!ctx->ring_pages) + if (!ctx->ring_pages) { + put_aio_ring_file(ctx); return -ENOMEM; + } } ctx->mmap_size = nr_pages * PAGE_SIZE; @@ -645,7 +647,7 @@ static struct kioctx *ioctx_alloc(unsigned nr_events) aio_nr + nr_events < aio_nr) { spin_unlock(&aio_nr_lock); err = -EAGAIN; - goto err; + goto err_ctx; } aio_nr += ctx->max_reqs; spin_unlock(&aio_nr_lock); @@ -662,6 +664,8 @@ static struct kioctx *ioctx_alloc(unsigned nr_events) err_cleanup: aio_nr_sub(ctx->max_reqs); +err_ctx: + aio_free_ring(ctx); err: free_percpu(ctx->cpu); free_percpu(ctx->reqs.pcpu_count); |