public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [rfc] weirdness in bio_map_user_iov()
@ 2016-09-21 21:52 Al Viro
  2016-09-23 21:47 ` Sagi Grimberg
  0 siblings, 1 reply; 2+ messages in thread
From: Al Viro @ 2016-09-21 21:52 UTC (permalink / raw)
  To: Jens Axboe; +Cc: linux-block, linux-kernel

What happens if we feed it a 3-element iovec array, one page in each?
AFAICS, bio_add_pc_page() is called for each of those pages, even if
the previous calls have failed - break is only out of the inner loop.

Sure, failure due to exceeded request size means that everything after
that one will fail, but what of e.g.
                /*
                 * If the queue doesn't support SG gaps and adding this
                 * offset would create a gap, disallow it.
                 */
                if (bvec_gap_to_prev(q, prev, offset))
                        return 0;
in there?  Won't we risk having the first and the third pages added, with
the second one quietly skipped?  Jens, looks like it had come from you
(by way of jejb).  Am I missing something subtle here?

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-09-23 21:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-21 21:52 [rfc] weirdness in bio_map_user_iov() Al Viro
2016-09-23 21:47 ` Sagi Grimberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox