From: Christoph Hellwig Date: Thu, 22 Nov 2018 15:44:07 +0000 (+0100) Subject: aio: clear IOCB_HIPRI X-Git-Tag: v4.19.38~36 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9101cbe70ef64c7f35fb75552005a3a696cc288e;p=thirdparty%2Fkernel%2Fstable.git aio: clear IOCB_HIPRI commit 154989e45fd8de9bfb52bbd6e5ea763e437e54c5 upstream. No one is going to poll for aio (yet), so we must clear the HIPRI flag, as we would otherwise send it down the poll queues, where no one will be polling for completions. Signed-off-by: Christoph Hellwig IOCB_HIPRI, not RWF_HIPRI. Reviewed-by: Johannes Thumshirn Signed-off-by: Jens Axboe Cc: Guenter Roeck Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/aio.c b/fs/aio.c index 45d5ef8dd0a87..78aa249070b13 100644 --- a/fs/aio.c +++ b/fs/aio.c @@ -1438,8 +1438,7 @@ static int aio_prep_rw(struct kiocb *req, struct iocb *iocb) ret = ioprio_check_cap(iocb->aio_reqprio); if (ret) { pr_debug("aio ioprio check cap error: %d\n", ret); - fput(req->ki_filp); - return ret; + goto out_fput; } req->ki_ioprio = iocb->aio_reqprio; @@ -1448,7 +1447,13 @@ static int aio_prep_rw(struct kiocb *req, struct iocb *iocb) ret = kiocb_set_rw_flags(req, iocb->aio_rw_flags); if (unlikely(ret)) - fput(req->ki_filp); + goto out_fput; + + req->ki_flags &= ~IOCB_HIPRI; /* no one is going to poll for this I/O */ + return 0; + +out_fput: + fput(req->ki_filp); return ret; }