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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200228203538.s52t64zcurna77cu@fiona>
Date:   Fri, 28 Feb 2020 14:35:38 -0600
From:   Goldwyn Rodrigues <rgoldwyn@...e.de>
To:     Matthew Wilcox <willy@...radead.org>
Cc:     Christoph Hellwig <hch@...radead.org>,
        Ritesh Harjani <riteshh@...ux.ibm.com>,
        linux-ext4@...r.kernel.org, linux-fsdevel@...r.kernel.org,
        darrick.wong@...cle.com
Subject: Re: [PATCH v2] iomap: return partial I/O count on error in
 iomap_dio_bio_actor

On 11:59 28/02, Matthew Wilcox wrote:
> On Fri, Feb 28, 2020 at 01:44:01PM -0600, Goldwyn Rodrigues wrote:
> > +++ b/fs/iomap/direct-io.c
> > @@ -264,7 +264,7 @@ iomap_dio_bio_actor(struct inode *inode, loff_t pos, loff_t length,
> >  		size_t n;
> >  		if (dio->error) {
> >  			iov_iter_revert(dio->submit.iter, copied);
> > -			copied = ret = 0;
> > +			ret = 0;
> >  			goto out;
> 
> There's another change here ... look at the out label
> 
> out:
>         /* Undo iter limitation to current extent */
>         iov_iter_reexpand(dio->submit.iter, orig_count - copied);
>         if (copied)
>                 return copied;
>         return ret;
> 
> so you're also changing by how much the iter is reexpanded.  I
> don't know if it's the appropriate amount; I still don't quite get the
> iov_iter complexities.
> 

Ah, okay. Now I understand what Christoph was saying.

I suppose it is safe to remove iov_iter_reexpand(). I don't see any
other goto to this label which will have a non-zero copied value.
And we have already performed the iov_iter_revert().

-- 
Goldwyn

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ