NetBSD-Bugs archive

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

Re: bin/57856: blkdiscard abort()s when not supplying a partition name



On 1/14/24 20:15, matthew green wrote:
> The following reply was made to PR bin/57856; it has been noted by GNATS.
> 
> From: matthew green <mrg%eterna23.net@localhost>
> To: gnats-bugs%netbsd.org@localhost, code-netbsd%yoyomail.de@localhost
> Cc: gnats-admin%netbsd.org@localhost, netbsd-bugs%netbsd.org@localhost
> Subject: re: bin/57856: blkdiscard abort()s when not supplying a partition name
> Date: Mon, 15 Jan 2024 06:14:47 +1100
> 
>  hi.
>  
>  
>  thanks for the PR.  i agree having easy to assert() code like this
>  is bad, and i'll fix it.
>  
>  can you tell me what actual command you used that triggered this?
>  i wonder if the code needs to understand that eg "wd0" means the
>  raw partition of "wd0", since /dev/wd0 is now a valid device name
>  for the same, but back when i originally wrote this code i don't
>  think it was yet common or on my systems yet.
>  
>  eg, instead of making this an error, perhaps it should assume
>  that kern.rawpartition is the partition, but first let's confirm
>  what actual args you used that triggered the problem.
>  
>  thanks.
>  
>  
>  .mrg.
>  

Hi,

like mentioned in the PR I literally invoked it as:

	# blkdiscard /dev/ld0
	assertion "partchar >= 'a' && partchar <= 'p'" failed: file "/usr/src/sbin/blkdiscard/blkdiscard.c", line 190, function "main"
	Abort (core dumped)

	# blkdiscard /dev/ld0d
	blkdiscard: fdiscard: Operation not supported by device

I picked ld0 because it attached on nvme0, and nvme0ns1 didn't work either:

	# blkdiscard /dev/nvme0ns1   
	unable to determine size.

FWIW, the dmesg for this nvme0 looks like:

[     1.013234] nvme0 at pci1 dev 0 function 0: Silicon Motion product 2263 (rev. 0x03)
[     1.013234] nvme0: NVMe 1.3
[     1.013234] nvme0: for admin queue interrupting at msix0 vec 0
[     1.013234] nvme0: Solid, firmware T1103F0L, serial 10222221B0019
[     1.013234] nvme0: for io queue 1 interrupting at msix0 vec 1 affinity to cpu0
[     1.013234] nvme0: for io queue 2 interrupting at msix0 vec 2 affinity to cpu1
[     1.013234] nvme0: for io queue 3 interrupting at msix0 vec 3 affinity to cpu2
[     1.013234] nvme0: for io queue 4 interrupting at msix0 vec 4 affinity to cpu3
[     1.013234] nvme0: for io queue 5 interrupting at msix0 vec 5 affinity to cpu4
[     1.013234] nvme0: for io queue 6 interrupting at msix0 vec 6 affinity to cpu5
[     1.013234] nvme0: for io queue 7 interrupting at msix0 vec 7 affinity to cpu6
[     1.013234] nvme0: for io queue 8 interrupting at msix0 vec 8 affinity to cpu7
[     1.013234] nvme0: for io queue 9 interrupting at msix0 vec 9 affinity to cpu8
[     1.013234] nvme0: for io queue 10 interrupting at msix0 vec 10 affinity to cpu9
[     1.013234] nvme0: for io queue 11 interrupting at msix0 vec 11 affinity to cpu10
[     1.013234] nvme0: for io queue 12 interrupting at msix0 vec 12 affinity to cpu11
[     1.013234] ld0 at nvme0 nsid 1


Thanks for having a look.



Home | Main Index | Thread Index | Old Index