Skip to content

Commit

Permalink
mkfs.nilfs2: fix wrong suggestion of minimum device size
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
konis committed Jul 22, 2019
1 parent 12dd3a1 commit c1608de
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sbin/mkfs/mkfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,8 @@ static void init_disk_layout(struct nilfs_disk_info *di, int fd,
" device size=%llu bytes, required size=%llu bytes.\n"
" Please enlarge the device, or shorten segments with -B option.",
dev_size,
(unsigned long long)segment_size * min_nsegments);
(unsigned long long)segment_size * min_nsegments +
blocksize);
di->nseginfo = 0;
}

Expand Down

0 comments on commit c1608de

Please sign in to comment.