Bart,

>> While the WARN_ON here looks helpful shouldn't we instead ensure that
>> sd_setup_rw6_cmnd never gets called with a 0 argument instead of bailing
>> out like this?
>
> Before I posted this patch I searched for code that submits read or
> write requests with length 0 but I haven't found any. do_iter_read()
> and do_iter_write() in fs/read_write.c do not submit any block layer
> requests if tot_len == 0. Are you perhaps aware of kernel code that
> can submit zero-length read or write requests?

At some level I would have liked the sanity check in the top rw prep
command. However, given that a zero transfer length is mostly a
hypothetical scenario I tend to concur with sticking the check in rw6
outside of the hot path.

-- 
Martin K. Petersen      Oracle Linux Engineering

Reply via email to