From: "Shah, Amit" <aams@amazon.de>
To: "Heyne, Maximilian" <mheyne@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:06:12 +0000 [thread overview]
Message-ID: <1541063172.6429.77.camel@amazon.com> (raw)
In-Reply-To: <38013dfb-f0af-bdc1-3547-c53ff6ecd58e@amazon.de>
On Do, 2018-11-01 at 09:03 +0100, Maximilian Heyne wrote:
> 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.
Yes, makes it also in line with the other callers, so this is good, thanks.
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
prev parent reply other threads:[~2018-11-01 9:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-30 21:57 [PATCH] fs: fix lost error code in dio_complete Maximilian Heyne
2018-10-31 5:46 ` Christoph Hellwig
2018-10-31 9:24 ` Shah, Amit
2018-11-01 8:03 ` Maximilian Heyne
2018-11-01 9:06 ` Shah, Amit [this message]
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=1541063172.6429.77.camel@amazon.com \
--to=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=mheyne@amazon.de \
--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;
as well as URLs for NNTP newsgroup(s).