Fixed prng xors during mdir splits/drops
We were unconditionally xoring our prng seed with mdir_[0]'s cksum, but
we should really use mdelta to xor in the relevant cksums.
This is a little bit more complicated, so adds a little bit of code:
code stack
before: 33442 2640
after: 33470 (+0.1%) 2640 (+0.0%)
This commit is contained in:
@@ -7051,7 +7051,12 @@ static int lfsr_mdir_commit(lfs_t *lfs, lfsr_mdir_t *mdir,
|
|||||||
// success? update in-device state, we must not error at this point
|
// success? update in-device state, we must not error at this point
|
||||||
|
|
||||||
// toss our cksum into the filesystem seed for pseudorandom numbers
|
// toss our cksum into the filesystem seed for pseudorandom numbers
|
||||||
lfs->seed ^= mdir_[0].rbyd.cksum;
|
if (mdelta >= 0) {
|
||||||
|
lfs->seed ^= mdir_[0].rbyd.cksum;
|
||||||
|
}
|
||||||
|
if (mdelta > 0) {
|
||||||
|
lfs->seed ^= mdir_[1].rbyd.cksum;
|
||||||
|
}
|
||||||
|
|
||||||
// update any gstate changes
|
// update any gstate changes
|
||||||
lfsr_fs_commitgdelta(lfs);
|
lfsr_fs_commitgdelta(lfs);
|
||||||
|
|||||||
Reference in New Issue
Block a user