Re: [PATCH RFC 1/6] block: Rework bio_split() return value

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

 



On 19/09/2024 16:50, Johannes Thumshirn wrote:
On 19.09.24 11:25, John Garry wrote:
-	BUG_ON(sectors <= 0);
-	BUG_ON(sectors >= bio_sectors(bio));
+	if (WARN_ON(sectors <= 0))
+		return ERR_PTR(-EINVAL);
+	if (WARN_ON(sectors >= bio_sectors(bio)))
+		return ERR_PTR(-EINVAL);

Nit: WARN_ON_ONCE() otherwise it'll trigger endless amounts of
stacktraces in dmesg.

Considering it is a BUG_ON() today, I don't expect this to be hit. And, even if it was, prob it would be some buggy corner case which occasionally occurs.

Anyway, I don't feel too strongly about this and I suppose a WARN_ON_ONCE() is ok.

Thanks,
John




[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