From: Maximilian Heyne <mheyne@amazon.de>
To: "Shah, Amit" <aams@amazon.de>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"Woodhouse, David" <dwmw@amazon.co.uk>, "hch@lst.de" <hch@lst.de>,
"stable@vger.kernel.org" <stable@vger.kernel.org>,
"viro@zeniv.linux.org.uk" <viro@zeniv.linux.org.uk>,
"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
"Dannowski, Uwe" <uwed@amazon.de>,
"Mehlan, Torsten" <tomeh@amazon.de>
Subject: Re: [PATCH] fs: fix lost error code in dio_complete
Date: Thu, 1 Nov 2018 09:03:19 +0100 [thread overview]
Message-ID: <38013dfb-f0af-bdc1-3547-c53ff6ecd58e@amazon.de> (raw)
In-Reply-To: <1540977883.6429.74.camel@amazon.com>
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
next prev parent reply other threads:[~2018-11-01 8:03 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-30 21:57 Maximilian Heyne
2018-10-31 5:46 ` Christoph Hellwig
2018-10-31 9:24 ` Shah, Amit
2018-11-01 8:03 ` Maximilian Heyne [this message]
2018-11-01 9:06 ` Shah, Amit
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=38013dfb-f0af-bdc1-3547-c53ff6ecd58e@amazon.de \
--to=mheyne@amazon.de \
--cc=aams@amazon.de \
--cc=dwmw@amazon.co.uk \
--cc=hch@lst.de \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=tomeh@amazon.de \
--cc=uwed@amazon.de \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®