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
F151659853: D10578.diff
Thu, Apr 9, 8:23 PM
F151620056: D10578.diff
Thu, Apr 9, 1:38 PM
Unknown Object (File)
Sun, Apr 5, 5:27 AM
Unknown Object (File)
Sat, Apr 4, 11:06 PM
Unknown Object (File)
Sat, Apr 4, 7:16 PM
Unknown Object (File)
Thu, Mar 19, 2:58 PM
Unknown Object (File)
Thu, Mar 19, 3:02 AM
Unknown Object (File)
Fri, Mar 13, 4:37 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