- Round up the journal size to the block size so we don't confuse fsck.
Reported by: Mikolaj Golub <to.my.trociny@gmail.com> - Only require 256k of blocks per-cg when trying to allocate contiguous journal blocks. The storage may not actually be contiguous but is at least within one cg. - When disabling SUJ leave SU enabled and report this to the user. It is expected that users will upgrade SU filesystems to SUJ and want a similar downgrade path.
This commit is contained in:
parent
5ed9b96420
commit
5305359514
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=208241
@ -358,10 +358,12 @@ main(int argc, char *argv[])
|
|||||||
warnx("%s remains unchanged as disabled", name);
|
warnx("%s remains unchanged as disabled", name);
|
||||||
} else {
|
} else {
|
||||||
journal_clear();
|
journal_clear();
|
||||||
sblock.fs_flags &= ~(FS_DOSOFTDEP | FS_SUJ);
|
sblock.fs_flags &= ~FS_SUJ;
|
||||||
sblock.fs_sujfree = 0;
|
sblock.fs_sujfree = 0;
|
||||||
warnx("%s cleared, "
|
warnx("%s cleared but soft updates still set.",
|
||||||
"remove .sujournal to reclaim space", name);
|
name);
|
||||||
|
|
||||||
|
warnx("remove .sujournal to reclaim space");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -546,7 +548,7 @@ journal_balloc(void)
|
|||||||
* Try to minimize fragmentation by requiring a minimum
|
* Try to minimize fragmentation by requiring a minimum
|
||||||
* number of blocks present.
|
* number of blocks present.
|
||||||
*/
|
*/
|
||||||
if (cgp->cg_cs.cs_nbfree > 128 * 1024 * 1024)
|
if (cgp->cg_cs.cs_nbfree > 256 * 1024)
|
||||||
break;
|
break;
|
||||||
if (contig == 0 && cgp->cg_cs.cs_nbfree)
|
if (contig == 0 && cgp->cg_cs.cs_nbfree)
|
||||||
break;
|
break;
|
||||||
@ -906,6 +908,8 @@ journal_alloc(int64_t size)
|
|||||||
if (size / sblock.fs_fsize > sblock.fs_fpg)
|
if (size / sblock.fs_fsize > sblock.fs_fpg)
|
||||||
size = sblock.fs_fpg * sblock.fs_fsize;
|
size = sblock.fs_fpg * sblock.fs_fsize;
|
||||||
size = MAX(SUJ_MIN, size);
|
size = MAX(SUJ_MIN, size);
|
||||||
|
/* fsck does not support fragments in journal files. */
|
||||||
|
size = roundup(size, sblock.fs_bsize);
|
||||||
}
|
}
|
||||||
resid = blocks = size / sblock.fs_bsize;
|
resid = blocks = size / sblock.fs_bsize;
|
||||||
if (sblock.fs_cstotal.cs_nbfree < blocks) {
|
if (sblock.fs_cstotal.cs_nbfree < blocks) {
|
||||||
|
Loading…
Reference in New Issue
Block a user