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)
Fri, Nov 8, 2:58 AM
Unknown Object (File)
Wed, Nov 6, 11:52 PM
Unknown Object (File)
Oct 6 2024, 12:35 AM
Unknown Object (File)
Oct 2 2024, 10:22 PM
Unknown Object (File)
Oct 2 2024, 8:12 PM
Unknown Object (File)
Oct 2 2024, 9:53 AM
Unknown Object (File)
Oct 1 2024, 10:13 AM
Unknown Object (File)
Sep 29 2024, 8:04 PM
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