Source-Changes-D archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
re: CVS commit: src/sys
> src/sys/kern: vfs_bio.c
> src/sys/sys: buf.h
>
> Log Message:
> Change buf_nbuf()'s return value from int to u_int to avoid undefined
> behavior in wapbl_start() which extended int to size_t.
>
> Error message was:
> > UBSan: Undefined Behavior in ../../../../kern/vfs_wapbl.c:609:41, signed integer overflow: 3345138 * 1024 cannot be represented in type 'int'
>
> > /* XXX maybe use filesystem fragment size instead of 1024 */
> > /* XXX fix actual number of buffers reserved per filesystem. */
> > wl->wl_bufcount_max = (buf_nbuf() / 2) * 1024;
>
> Need more work?
i would have made buf_nbuf() return size_t.
.mrg.
Home |
Main Index |
Thread Index |
Old Index