Page MenuHomeFreeBSD

fs.h: fix signed/unsigned issues, from NetBSD
AbandonedPublic

Authored by emaste on May 3 2017, 12:39 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, May 19, 1:22 PM
Unknown Object (File)
Mon, May 18, 3:56 PM
Unknown Object (File)
Wed, May 6, 12:21 AM
Unknown Object (File)
Thu, Apr 30, 3:36 PM
Unknown Object (File)
Thu, Apr 30, 12:55 PM
Unknown Object (File)
Apr 18 2026, 12:56 AM
Unknown Object (File)
Apr 17 2026, 11:49 AM
Unknown Object (File)
Apr 15 2026, 10:46 AM
Subscribers
None

Details

Reviewers
mckusick
kib
Summary
Test Plan

Tinderbox build

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

I dislike the direct use of uint64_t for disk address. Some abstraction is IMO warranted there, off_t use was relatively sane.

Note that our daddr_t type, which represents disk block number, is also signed.

The signedness warning arises because the UFS dinode di_size is u_int64_t. Is the right fix then just to sprinkle casts everywhere?

The signedness warning arises because the UFS dinode di_size is u_int64_t. Is the right fix then just to sprinkle casts everywhere?

I am not sure, and since I noted that e.g. lblktosize() is legitimately used for extended data blocks, which have negative indexes, I think changing signess there is tricky.
Are there too many relateed warnings in the makefs code ? Does makefs support ext attributes on UFS ?

sys/ufs/ffs/fs.h
577

For this change, please take a look at ufs/ffs/ffs_softdep.c:trunc_pages(). I suspect that it would break the calculation, or at least more consideration is required.

Instead of this change I can use D10589 and some casts sprinkled in makefs.

sys/ufs/ffs/fs.h
611

related issue arises here, where i_size is uint64_t and smallblktosize is signed