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)
Feb 18 2024, 1:47 AM
Unknown Object (File)
Dec 20 2023, 2:52 AM
Unknown Object (File)
Jul 21 2023, 10:39 PM
Unknown Object (File)
May 27 2023, 12:50 AM
Unknown Object (File)
Dec 25 2022, 12:52 PM
Unknown Object (File)
Dec 25 2022, 7:00 AM
Unknown Object (File)
Dec 23 2022, 5:56 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