aio: clear IOCB_HIPRI
authorChristoph Hellwig <hch@lst.de>
Thu, 22 Nov 2018 15:44:07 +0000 (16:44 +0100)
committerJens Axboe <axboe@kernel.dk>
Tue, 4 Dec 2018 16:39:06 +0000 (09:39 -0700)
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 <hch@lst.de>
IOCB_HIPRI, not RWF_HIPRI.

Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/aio.c

index 205390c0c1bb4bf41ce12b36e8c85152f8de7dea..05647d352bf390283e9dac5223fc3f1ebf1be4bc 100644 (file)
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -1436,8 +1436,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;
@@ -1446,7 +1445,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;
 }