[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <38013dfb-f0af-bdc1-3547-c53ff6ecd58e@amazon.de>
Date: Thu, 1 Nov 2018 09:03:19 +0100
From: Maximilian Heyne <mheyne@...zon.de>
To: "Shah, Amit" <aams@...zon.de>
CC: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"Woodhouse, David" <dwmw@...zon.co.uk>, "hch@....de" <hch@....de>,
"stable@...r.kernel.org" <stable@...r.kernel.org>,
"viro@...iv.linux.org.uk" <viro@...iv.linux.org.uk>,
"linux-fsdevel@...r.kernel.org" <linux-fsdevel@...r.kernel.org>,
"Dannowski, Uwe" <uwed@...zon.de>,
"Mehlan, Torsten" <tomeh@...zon.de>
Subject: Re: [PATCH] fs: fix lost error code in dio_complete
On 10/31/18 10:24 AM, Shah, Amit wrote:
> On Di, 2018-10-30 at 21:57 +0000, Maximilian Heyne wrote:
>> [...]
>>
>> diff --git a/fs/direct-io.c b/fs/direct-io.c
>> index 093fb54cd316..199146036093 100644
>> --- a/fs/direct-io.c
>> +++ b/fs/direct-io.c
>> @@ -325,8 +325,8 @@ static ssize_t dio_complete(struct dio *dio, ssize_t ret, unsigned int flags)
>> */
>> dio->iocb->ki_pos += transferred;
>>
>> - if (dio->op == REQ_OP_WRITE)
>> - ret = generic_write_sync(dio->iocb, transferred);
>> + if (ret > 0 && dio->op == REQ_OP_WRITE)
>> + ret = generic_write_sync(dio->iocb, ret);
> Is the s/transferred/ret/ change necessary? Needs explaining, at least.
In an above code line `ret` is set to `transferred`. So the change is
a no op. However, in my opinion the construct then looks cleaner.
>> dio->iocb->ki_complete(dio->iocb, ret, 0);
>> }
>>
> Thanks,
>
>
>
> Amit
Amazon Development Center Germany GmbH
Krausenstr. 38
10117 Berlin
Geschaeftsfuehrer: Christian Schlaeger, Ralf Herbrich
Ust-ID: DE 289 237 879
Eingetragen am Amtsgericht Charlottenburg HRB 149173 B
Powered by blists - more mailing lists