diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-03-06 14:33:22 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-03-20 21:29:38 -0400 |
commit | e23754f880f10124f0a2848f9d17e361a295378e (patch) | |
tree | c4e3b11b21e24227179f04314ed0b774524f8c28 /fs/aio.c | |
parent | 5d026c7242201e7c9d0e12fcb2bcaffead9d59fd (diff) |
aio: don't bother with async freeing on failure in ioctx_alloc()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/aio.c')
-rw-r--r-- | fs/aio.c | 12 |
1 files changed, 5 insertions, 7 deletions
@@ -248,6 +248,7 @@ static struct kioctx *ioctx_alloc(unsigned nr_events) | |||
248 | struct mm_struct *mm; | 248 | struct mm_struct *mm; |
249 | struct kioctx *ctx; | 249 | struct kioctx *ctx; |
250 | int did_sync = 0; | 250 | int did_sync = 0; |
251 | int err = -ENOMEM; | ||
251 | 252 | ||
252 | /* Prevent overflows */ | 253 | /* Prevent overflows */ |
253 | if ((nr_events > (0x10000000U / sizeof(struct io_event))) || | 254 | if ((nr_events > (0x10000000U / sizeof(struct io_event))) || |
@@ -310,16 +311,13 @@ static struct kioctx *ioctx_alloc(unsigned nr_events) | |||
310 | return ctx; | 311 | return ctx; |
311 | 312 | ||
312 | out_cleanup: | 313 | out_cleanup: |
313 | __put_ioctx(ctx); | 314 | err = -EAGAIN; |
314 | return ERR_PTR(-EAGAIN); | 315 | aio_free_ring(ctx); |
315 | |||
316 | out_freectx: | 316 | out_freectx: |
317 | mmdrop(mm); | 317 | mmdrop(mm); |
318 | kmem_cache_free(kioctx_cachep, ctx); | 318 | kmem_cache_free(kioctx_cachep, ctx); |
319 | ctx = ERR_PTR(-ENOMEM); | 319 | dprintk("aio: error allocating ioctx %d\n", err); |
320 | 320 | return ERR_PTR(err); | |
321 | dprintk("aio: error allocating ioctx %p\n", ctx); | ||
322 | return ctx; | ||
323 | } | 321 | } |
324 | 322 | ||
325 | /* aio_cancel_all | 323 | /* aio_cancel_all |