Messages in this thread | | | From | David Howells <> | Subject | Re: [PATCH 03/24] iov_iter: Add I/O discard iterator | Date | Mon, 22 Oct 2018 17:18:00 +0100 |
| |
Al Viro <viro@ZenIV.linux.org.uk> wrote:
> > @@ -1060,6 +1074,9 @@ void iov_iter_revert(struct iov_iter *i, size_t unroll) > > } > > unroll -= i->iov_offset; > > switch (iov_iter_type(i)) { > > + case ITER_DISCARD: > > + i->iov_offset = 0; > > + return; > > ... the hell? That makes no sense whatsoever; what, besides this and immediately > preceding part of iov_iter_revert() so much as looks at ->iov_offset for those? > Just have it bugger off before the > if (unroll <= i->iov_offset) { > i->iov_offset -= unroll; > return; > } > bit...
I didn't want to add another case before that if I could avoid it. If iov_offset > unroll, the discard iterator really doesn't care. Maybe I should just ignore iov_offset for the discard iterator.
David
| |