From: Jens Axboe <axboe@kernel.dk>
To: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: "linux-aio@kvack.org" <linux-aio@kvack.org>,
linux-fsdevel <linux-fsdevel@vger.kernel.org>
Subject: [PATCH] aio: fix failure to put the file pointer
Date: Sat, 17 Nov 2018 07:37:44 -0700 [thread overview]
Message-ID: <80eae85d-c307-71fb-bdfe-5a38236fbf87@kernel.dk> (raw)
If the ioprio capability check fails, we return without putting
the file pointer.
Fixes: d9a08a9e616b ("fs: Add aio iopriority support")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
diff --git a/fs/aio.c b/fs/aio.c
index b36691268b6c..9075571e673f 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -1436,7 +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);
- return ret;
+ goto err;
}
req->ki_ioprio = iocb->aio_reqprio;
@@ -1444,6 +1444,7 @@ static int aio_prep_rw(struct kiocb *req, struct iocb *iocb)
req->ki_ioprio = IOPRIO_PRIO_VALUE(IOPRIO_CLASS_NONE, 0);
ret = kiocb_set_rw_flags(req, iocb->aio_rw_flags);
+err:
if (unlikely(ret))
fput(req->ki_filp);
return ret;
--
Jens Axboe
next reply other threads:[~2018-11-18 0:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-17 14:37 Jens Axboe [this message]
2018-11-17 14:40 ` [PATCH] aio: fix failure to put the file pointer Al Viro
2018-11-17 14:43 ` Jens Axboe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=80eae85d-c307-71fb-bdfe-5a38236fbf87@kernel.dk \
--to=axboe@kernel.dk \
--cc=linux-aio@kvack.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.