On 1/28/23 11:48, Bart Van Assche wrote: > On 1/27/23 17:18, Damien Le Moal wrote: >> On 1/28/23 09:59, Bart Van Assche wrote: >>> + WARN_ONCE(len > dev->max_segment_size, "%u > %u\n", len, >>> + dev->max_segment_size); >> >> Shouldn't this be an EIO return as this is not supposed to happen ? > > Hmm ... the above WARN_ONCE() statement is intended as a precondition > check. This statement is intended as a help for developers to check that > the code below works fine. I'm not sure how returning EIO here would help? My point was that given that null_transfer() is called like this: rq_for_each_segment(bvec, rq, iter) { len = bvec.bv_len; err = null_transfer(nullb, bvec.bv_page, len, bvec.bv_offset, ...); len should never be larger than max_segment_size, no ? Unless I am missing something else... > > Thanks > > Bart. -- Damien Le Moal Western Digital Research