[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YIV5wyBWC18/DAoU@zeniv-ca.linux.org.uk>
Date: Sun, 25 Apr 2021 14:16:35 +0000
From: Al Viro <viro@...iv.linux.org.uk>
To: David Howells <dhowells@...hat.com>
Cc: linux-fsdevel@...r.kernel.org,
Dave Wysochanski <dwysocha@...hat.com>,
Marc Dionne <marc.dionne@...istor.com>,
"Matthew Wilcox (Oracle)" <willy@...radead.org>,
Christoph Hellwig <hch@....de>, linux-mm@...ck.org,
linux-cachefs@...hat.com, linux-afs@...ts.infradead.org,
linux-nfs@...r.kernel.org, linux-cifs@...r.kernel.org,
ceph-devel@...r.kernel.org, v9fs-developer@...ts.sourceforge.net,
Trond Myklebust <trond.myklebust@...merspace.com>,
Anna Schumaker <anna.schumaker@...app.com>,
Steve French <sfrench@...ba.org>,
Dominique Martinet <asmadeus@...ewreck.org>,
Jeff Layton <jlayton@...hat.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v7 01/31] iov_iter: Add ITER_XARRAY
On Sun, Apr 25, 2021 at 02:58:02PM +0100, David Howells wrote:
> But for the moment, I guess I should just add:
>
> i->iov_offset += bytes;
>
> to all three (kvec, bvec and xarray)?
No. First of all, you'd need ->count updated as well; for kvec and bvec you
*REALLY* don't have to end up with ->iov_offset exceeding the size of current
kvec or bvec resp.; Bad Shit(tm) happens that way.
>
> > > @@ -1246,7 +1349,8 @@ unsigned long iov_iter_alignment(const struct iov_iter *i)
> > > iterate_all_kinds(i, size, v,
> > > (res |= (unsigned long)v.iov_base | v.iov_len, 0),
> > > res |= v.bv_offset | v.bv_len,
> > > - res |= (unsigned long)v.iov_base | v.iov_len
> > > + res |= (unsigned long)v.iov_base | v.iov_len,
> > > + res |= v.bv_offset | v.bv_len
> > > )
> > > return res;
> > > }
> >
> > Hmm... That looks like a really bad overkill - do you need anything beyond
> > count and iov_offset in that case + perhaps "do we have the very last page"?
> > IOW, do you need to iterate anything at all here? What am I missing here?
>
> Good point. I wonder, even, if the alignment could just be set to 1. There's
> no kdoc description on the function that says what the result is meant to
> represent.
Huh? It's the worst alignment of all segment boundaries, what else? As in
if (iov_iter_alignment(i) & 1023)
// we have something in there that isn't 1K-aligned.
Powered by blists - more mailing lists