MFC 1.47: increment the disk block offset after writing, not before.
This fixes filesystem corruption when nextboot.conf is located after cylinder 1023. PR: bin/98005
This commit is contained in:
parent
5666262af1
commit
3de7d79a42
@ -1040,9 +1040,6 @@ bd_write(struct open_disk *od, daddr_t dblk, int blks, caddr_t dest)
|
||||
*/
|
||||
if (bbuf != NULL)
|
||||
bcopy(p, breg, x * BIOSDISK_SECSIZE);
|
||||
p += (x * BIOSDISK_SECSIZE);
|
||||
dblk += x;
|
||||
resid -= x;
|
||||
|
||||
/* Loop retrying the operation a couple of times. The BIOS may also retry. */
|
||||
for (retry = 0; retry < 3; retry++) {
|
||||
@ -1108,6 +1105,9 @@ bd_write(struct open_disk *od, daddr_t dblk, int blks, caddr_t dest)
|
||||
free(bbuf);
|
||||
return(-1);
|
||||
}
|
||||
p += (x * BIOSDISK_SECSIZE);
|
||||
dblk += x;
|
||||
resid -= x;
|
||||
}
|
||||
|
||||
/* hexdump(dest, (blks * BIOSDISK_SECSIZE)); */
|
||||
|
Loading…
x
Reference in New Issue
Block a user