lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1541063172.6429.77.camel@amazon.com>
Date:   Thu, 1 Nov 2018 09:06:12 +0000
From:   "Shah, Amit" <aams@...zon.de>
To:     "Heyne, Maximilian" <mheyne@...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 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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ