Fix fsck_ffs incorrectly reporting "CANNOT READ BLK: NNNN" errors.
A long-standing bug in Pass 1 of fsck_ffs in which it is reading in blocks of inodes to check their block pointers. It failed to round up the size of the read to a disk block size. When disks would accept 512-byte aligned reads, the bug rarely manifested itself. But many recent disks will no longer accept 512-byte aligned reads but require 4096-byte aligned reads, so the failure to properly round-up read sizes to multiples of 4096 bytes makes the error much more likely to occur. Reported by: Peter Holm and others Tested by: Peter Holm and Rozhuk Ivan MFC after: 3 days Sponsored by: Netflix
This commit is contained in:
parent
2cf8425892
commit
8c22cf9b09
@ -611,8 +611,9 @@ setinodebuf(int cg, ino_t inosused)
|
|||||||
sizeof(struct ufs1_dinode) : sizeof(struct ufs2_dinode));
|
sizeof(struct ufs1_dinode) : sizeof(struct ufs2_dinode));
|
||||||
readpercg = inosused / fullcnt;
|
readpercg = inosused / fullcnt;
|
||||||
partialcnt = inosused % fullcnt;
|
partialcnt = inosused % fullcnt;
|
||||||
partialsize = partialcnt * ((sblock.fs_magic == FS_UFS1_MAGIC) ?
|
partialsize = fragroundup(&sblock,
|
||||||
sizeof(struct ufs1_dinode) : sizeof(struct ufs2_dinode));
|
partialcnt * ((sblock.fs_magic == FS_UFS1_MAGIC) ?
|
||||||
|
sizeof(struct ufs1_dinode) : sizeof(struct ufs2_dinode)));
|
||||||
if (partialcnt != 0) {
|
if (partialcnt != 0) {
|
||||||
readpercg++;
|
readpercg++;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user