[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y1wt7uzL7vkBQ6Vm@ZenIV>
Date: Fri, 28 Oct 2022 20:30:54 +0100
From: Al Viro <viro@...iv.linux.org.uk>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Christoph Hellwig <hch@...radead.org>,
David Howells <dhowells@...hat.com>, willy@...radead.org,
dchinner@...hat.com, Steve French <smfrench@...il.com>,
Shyam Prasad N <nspmangalore@...il.com>,
Rohith Surabattula <rohiths.msft@...il.com>,
Jeff Layton <jlayton@...nel.org>,
Ira Weiny <ira.weiny@...el.com>, linux-cifs@...r.kernel.org,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 12/12] use less confusing names for iov_iter direction
initializers
On Fri, Oct 28, 2022 at 11:35:06AM -0700, Linus Torvalds wrote:
> > Umm... How are you going to e.g. copy from ITER_DISCARD? I've no problem
> > with WARN_ON_ONCE(), but when the operation really can't be done, what
> > can we do except returning an error?
>
> Fair enough. But it's the "people got the direction wrong, but the
> code worked" case that I would want tyo make sure still works - just
> with a warning.
>
> Clearly the ITER_DISCARD didn't work before either, but all the cases
> in patches 1-10 were things that _worked_, just with entirely the
> wrong ->data_source (aka iov_iter_rw()) value.
>
> So things like copy_to_iter() should warn if it's not a READ (or
> ITER_DEST), but it should still copy into the destination described by
> the iter, in order to keep broken code working.
>
> That's simply because I worry that your patches 1-10 didn't actually
> catch every single case. I'm not actually sure how you found them all
> - did you have some automation, or was it with "boot and find warnings
> from the first version of patch 11/12"?
Went through the callers, replaced each with the right ITER_... (there's
not that many of them and they are fairly easy to review), then went
through mismatches and split their fixups into the beginning of the
series (READ -> ITER_SOURCE becoming READ -> WRITE -> ITER_SOURCE, that
is).
FWIW, there used to be one case where we really tried to copy the wrong
way - fixed a couple of cycles ago (f615625a44c4 "9p: handling Rerror
without copy_from_iter_full()"). No such catches this time...
Powered by blists - more mailing lists