mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-01 12:19:28 +00:00
Fix a couple of bogus casts to off_t that caused dumpfs to lseek negative
on filesystems > 2GB (which causes the disk slice code to call Debugger!!)
This commit is contained in:
parent
7dd9508fc2
commit
7976d4aa4f
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=16603
@ -183,8 +183,8 @@ dumpfs(name)
|
||||
afs.fs_cssize - i : afs.fs_bsize;
|
||||
afs.fs_csp[j] = calloc(1, size);
|
||||
if (lseek(fd,
|
||||
(off_t)(fsbtodb(&afs, (afs.fs_csaddr + j * afs.fs_frag)) *
|
||||
dev_bsize), SEEK_SET) == (off_t)-1)
|
||||
(off_t)(fsbtodb(&afs, (afs.fs_csaddr + j * afs.fs_frag))) *
|
||||
(off_t)dev_bsize, SEEK_SET) == (off_t)-1)
|
||||
goto err;
|
||||
if (read(fd, afs.fs_csp[j], size) != size)
|
||||
goto err;
|
||||
@ -225,8 +225,8 @@ dumpcg(name, fd, c)
|
||||
int i, j;
|
||||
|
||||
printf("\ncg %d:\n", c);
|
||||
if ((cur = lseek(fd, (off_t)(fsbtodb(&afs, cgtod(&afs, c)) * dev_bsize),
|
||||
SEEK_SET)) == (off_t)-1)
|
||||
if ((cur = lseek(fd, (off_t)(fsbtodb(&afs, cgtod(&afs, c))) *
|
||||
(off_t)dev_bsize, SEEK_SET)) == (off_t)-1)
|
||||
return (1);
|
||||
if (read(fd, &acg, afs.fs_bsize) != afs.fs_bsize) {
|
||||
(void)fprintf(stderr, "dumpfs: %s: error reading cg\n", name);
|
||||
|
Loading…
Reference in New Issue
Block a user