Source-Changes-D archive

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

Re: CVS commit: src



> Module Name:    src
> Committed By:   tls
> Date:           Sun Oct 18 14:56:33 UTC 2026
> 
> Modified Files:
>         src/sbin/raidctl: raidctl.c rf_configure.c
>         src/sys/dev/raidframe: raidframevar.h rf_diskqueue.c rf_diskqueue.h
>             rf_netbsdkintf.c
> 
> Log Message:
> Fix PR kern/60896 queue-length bugs in RAIDframe configuration.
> 
> ...
> 
> +       if (clabel->maxOutstanding <= 0)
> +               config->maxOutstandingDiskReqs = RF_DEFAULT_QUEUE_DEPTH;
> +       else if (clabel->maxOutstanding > RF_MAX_QUEUE_DEPTH)
> +               config->maxOutstandingDiskReqs = RF_MAX_QUEUE_DEPTH;
> +       else
> +               config->maxOutstandingDiskReqs =
> +                   (uint8_t)clabel->maxOutstanding;

Did you forget to change maxOutstandingDiskReqs from `char' to
`unsigned char' or `uint8_t'?

The clang build is failing now on platforms where char is signed:

> /home/source/ab/HEAD-llvm/src/sys/rump/dev/lib/libraidframe/../../../../dev/raidframe/rf_netbsdkintf.c:3512:36: error: implicit conversion from 'int' to 'char' changes value from 255 to -1 [-Werror,-Wconstant-conversion]
>                 config->maxOutstandingDiskReqs = RF_MAX_QUEUE_DEPTH;
>                                                ~ ^~~~~~~~~~~~~~~~~~
> /home/source/ab/HEAD-llvm/src/sys/rump/dev/lib/libraidframe/../../../../dev/raidframe/raidframevar.h:338:28: note: expanded from macro 'RF_MAX_QUEUE_DEPTH'
> #define RF_MAX_QUEUE_DEPTH      255
>                                 ^~~
> 1 error generated.
> --- rf_netbsdkintf.pico ---

    321 struct RF_Config_s {
...
    336 	char    maxOutstandingDiskReqs;	/* # concurrent reqs to be sent to a
    337 					 * disk (uint8_t, 1..255). */

https://nxr.netbsd.org/xref/src/sys/dev/raidframe/raidframevar.h?r=1.24#336

Perhaps there are enough casts downstream that this hasn't created new
runtime issues, but it's bad if the declared type is mismatched with
reality so that all actual uses require casts.


Home | Main Index | Thread Index | Old Index