diff options
author | bde <bde@FreeBSD.org> | 1996-10-12 22:12:51 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 1996-10-12 22:12:51 +0000 |
commit | 9e1f278658af7e178ea432e182793d78905b493e (patch) | |
tree | c3bd51a94c3f955a5b0f36e65d5bfbfefc0916d1 /sbin/fsck/setup.c | |
parent | bf13e7f997852f46fb2757e545567fff0ee41cb5 (diff) | |
download | FreeBSD-src-9e1f278658af7e178ea432e182793d78905b493e.zip FreeBSD-src-9e1f278658af7e178ea432e182793d78905b493e.tar.gz |
Fixed lblktosize(). It overflowed at 2G. This bug only affected
ufs_read() and ufs_write().
Found by: looking at warnings for comparing the result of lblktosize()
(which is usually daddr_t = long) with file sizes (which are u_quad_t
for ufs). File sizes should probably be off_t's to avoid warnings
when the are compared with file offsets, so the fixed lblktosize()
casts to off_t instead of u_quad_t.
Added definition of smalllblksize(). It is the same as the old
lblksize() and is more efficient for small block numbers on 32-bit
machines.
Use smalllblktosize() instead of its expansion in blksize() and
dblksize(). This keeps the line length short and makes it more
obvious that the shift can't overflow.
Diffstat (limited to 'sbin/fsck/setup.c')
0 files changed, 0 insertions, 0 deletions