From 886e9f061c29ac6a02fc170ad4cec515f2c09525 Mon Sep 17 00:00:00 2001 From: Kirk McKusick Date: Sat, 2 Mar 2019 21:22:56 +0000 Subject: [PATCH] The size of the UFS soft-updates journal must be a multiple of the filesystem block size. When a size is specified with the -S flag to tunefs(8), round it up to the filesystem block size. Reported by: Peter Holm Tested by: Peter Holm Sponsored by: Netflix --- sbin/tunefs/tunefs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sbin/tunefs/tunefs.c b/sbin/tunefs/tunefs.c index 9ae879ec1285..40bcbb1487f2 100644 --- a/sbin/tunefs/tunefs.c +++ b/sbin/tunefs/tunefs.c @@ -971,9 +971,9 @@ journal_alloc(int64_t size) if (size / sblock.fs_fsize > sblock.fs_fpg) size = sblock.fs_fpg * sblock.fs_fsize; size = MAX(SUJ_MIN, size); - /* fsck does not support fragments in journal files. */ - size = roundup(size, sblock.fs_bsize); } + /* fsck does not support fragments in journal files. */ + size = roundup(size, sblock.fs_bsize); resid = blocks = size / sblock.fs_bsize; if (sblock.fs_cstotal.cs_nbfree < blocks) { warn("Insufficient free space for %jd byte journal", size);