Skip to content

Commit c1608de

Browse files
committed
mkfs.nilfs2: fix wrong suggestion of minimum device size
Even if we give "required size" that mkfs.nilfs2 suggests for too small devices, mkfs.nilfs2 fails due to the lack of consideration of the trailing super block: Error: too small device. device size=134217728 bytes, required size=134217728 bytes. Please enlarge the device, or shorten segments with -B option. This fixes the issue. Signed-off-by: Ryusuke Konishi <[email protected]>
1 parent 12dd3a1 commit c1608de

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sbin/mkfs/mkfs.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,8 @@ static void init_disk_layout(struct nilfs_disk_info *di, int fd,
509509
" device size=%llu bytes, required size=%llu bytes.\n"
510510
" Please enlarge the device, or shorten segments with -B option.",
511511
dev_size,
512-
(unsigned long long)segment_size * min_nsegments);
512+
(unsigned long long)segment_size * min_nsegments +
513+
blocksize);
513514
di->nseginfo = 0;
514515
}
515516

0 commit comments

Comments
 (0)