diff options
author | avg <avg@FreeBSD.org> | 2009-08-20 10:57:14 +0000 |
---|---|---|
committer | avg <avg@FreeBSD.org> | 2009-08-20 10:57:14 +0000 |
commit | ab0b6203abac22f7fa981c24cf452d3dab032727 (patch) | |
tree | f9fcf0b99a48325c78752a17b36f2ea0260d16a4 /sys/dev/usb/net/usb_ethernet.c | |
parent | 12476e655030b51898ca1cfaa89401f3a182aba1 (diff) | |
download | FreeBSD-src-ab0b6203abac22f7fa981c24cf452d3dab032727.zip FreeBSD-src-ab0b6203abac22f7fa981c24cf452d3dab032727.tar.gz |
fstat: fix fsid comparison when executed on systems with 64-bit long
This affects only fstat on zfs and devfs, only on 64-bit systems
and only when fsid is greater than 2^31 - 1.
When fstat examines a file via stat(2) it takes uint32_t st_dev
and assigns to (signed) (64-bit) long fsid, this results in
a positive value.
When fstat examines opened files it takes int32_t f_fsid.val[0]
and assigns to (signed) (64-bit) long fsid, this results in
a negative value.
So, while initially st_dev and f_fsid.val[0] have the same bit
values they get promoted to different 64-bit values because
of the signed-vs-unsigned difference.
A fix is to use "more natural" positive numbers by introducing
intermediate unsigned cast for f_fsid.val[0].
Reviewed by: jhb, lulf
Approved by: re (kib)
MFC after: 1 week (to stable/7)
Diffstat (limited to 'sys/dev/usb/net/usb_ethernet.c')
0 files changed, 0 insertions, 0 deletions