Linux filesystem development
 help / color / mirror / Atom feed
* [PATCH] aio: fix failure to put the file pointer
@ 2018-11-17 14:37 Jens Axboe
  2018-11-17 14:40 ` Al Viro
  0 siblings, 1 reply; 3+ messages in thread
From: Jens Axboe @ 2018-11-17 14:37 UTC (permalink / raw)
  To: Alexander Viro; +Cc: linux-aio@kvack.org, linux-fsdevel

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] aio: fix failure to put the file pointer
  2018-11-17 14:37 [PATCH] aio: fix failure to put the file pointer Jens Axboe
@ 2018-11-17 14:40 ` Al Viro
  2018-11-17 14:43   ` Jens Axboe
  0 siblings, 1 reply; 3+ messages in thread
From: Al Viro @ 2018-11-17 14:40 UTC (permalink / raw)
  To: Jens Axboe; +Cc: linux-aio@kvack.org, linux-fsdevel

On Sat, Nov 17, 2018 at 07:37:44AM -0700, Jens Axboe wrote:
> 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;

Better an explicit fput() here, IMO...

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] aio: fix failure to put the file pointer
  2018-11-17 14:40 ` Al Viro
@ 2018-11-17 14:43   ` Jens Axboe
  0 siblings, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2018-11-17 14:43 UTC (permalink / raw)
  To: Al Viro; +Cc: linux-aio@kvack.org, linux-fsdevel

On 11/17/18 7:40 AM, Al Viro wrote:
> On Sat, Nov 17, 2018 at 07:37:44AM -0700, Jens Axboe wrote:
>> 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;
> 
> Better an explicit fput() here, IMO...

OK, v2 sent.

-- 
Jens Axboe

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-11-18  1:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-17 14:37 [PATCH] aio: fix failure to put the file pointer Jens Axboe
2018-11-17 14:40 ` Al Viro
2018-11-17 14:43   ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox