Re: [PATCH] null_blk: Support configuring the maximum segment size

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 1/28/23 18:03, Damien Le Moal wrote:
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...

Hi Damien,

null_transfer() supports the case len > dev->max_segment_size so I think that a warning is sufficient and also that we don't need to return -EIO.

Thanks,

Bart.




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux