On Mon, Apr 04, 2016 at 06:16:12PM +0100, Al Viro wrote: > Another fun question: should the normal sg_io() copy the buffer in on > SG_DXFER_TO_FROM_DEV? Right now it doesn't; in !copy case (when it goes > through bio_map_user_iov()) the effect is achieved simply by doing the > read into the pages user has mapped in that area, but bio_copy_user_iov() > doesn't do it: > /* > * success > */ > if (((iter->type & WRITE) && (!map_data || !map_data->null_mapped)) || > (map_data && map_data->from_user)) { > ret = bio_copy_from_iter(bio, *iter); > if (ret) > goto cleanup; > } > will see NULL map_data; the ->from_user case is sg_start_req() stuff. IOW, > SG_IO behaviour for /dev/sg* is different from the generic one...
meh. I really wish /dev/sg was just using the generic page pool :(