mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-12-20 15:26:43 +01:00
Avoid segment fault when attempting to clean up cylinder group
buffer cache. PR: 187221 Submitted by: Petr Lampa <lampa@fit.vutbr.cz> Obtained from: Petr Lampa <lampa@fit.vutbr.cz> MFC after: 1 week
This commit is contained in:
parent
22b8ff24b5
commit
e2f4949a4a
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=263062
@ -436,13 +436,15 @@ ckfini(int markclean)
|
||||
}
|
||||
if (numbufs != cnt)
|
||||
errx(EEXIT, "panic: lost %d buffers", numbufs - cnt);
|
||||
for (cnt = 0; cnt < sblock.fs_ncg; cnt++) {
|
||||
if (cgbufs[cnt].b_un.b_cg == NULL)
|
||||
continue;
|
||||
flush(fswritefd, &cgbufs[cnt]);
|
||||
free(cgbufs[cnt].b_un.b_cg);
|
||||
if (cgbufs != NULL) {
|
||||
for (cnt = 0; cnt < sblock.fs_ncg; cnt++) {
|
||||
if (cgbufs[cnt].b_un.b_cg == NULL)
|
||||
continue;
|
||||
flush(fswritefd, &cgbufs[cnt]);
|
||||
free(cgbufs[cnt].b_un.b_cg);
|
||||
}
|
||||
free(cgbufs);
|
||||
}
|
||||
free(cgbufs);
|
||||
pbp = pdirbp = (struct bufarea *)0;
|
||||
if (cursnapshot == 0 && sblock.fs_clean != markclean) {
|
||||
if ((sblock.fs_clean = markclean) != 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user