retval = ext2fs_read_bb_FILE(fs, f, bb_list, invalid_block);
fclose (f);
if (retval) {
- com_err("ext2fs_read_bb_FILE", retval,
+ com_err("ext2fs_read_bb_FILE", retval, "%s",
_("while reading in list of bad blocks from file"));
exit(1);
}
retval = ext2fs_read_bb_FILE(fs, f, bb_list, invalid_block);
pclose(f);
if (retval) {
- com_err("ext2fs_read_bb_FILE", retval,
+ com_err("ext2fs_read_bb_FILE", retval, "%s",
_("while processing list of bad blocks from program"));
exit(1);
}
*/
retval = ext2fs_badblocks_list_iterate_begin(bb_list, &bb_iter);
if (retval) {
- com_err("ext2fs_badblocks_list_iterate_begin", retval,
+ com_err("ext2fs_badblocks_list_iterate_begin", retval, "%s",
_("while marking bad blocks as used"));
exit(1);
}
{
errcode_t retval;
struct ext2_inode inode;
- __u32 uid, gid;
retval = ext2fs_mkdir(fs, EXT2_ROOT_INO, EXT2_ROOT_INO, 0);
if (retval) {
- com_err("ext2fs_mkdir", retval, _("while creating root dir"));
+ com_err("ext2fs_mkdir", retval, "%s",
+ _("while creating root dir"));
exit(1);
}
if (root_uid != 0 || root_gid != 0) {
retval = ext2fs_read_inode(fs, EXT2_ROOT_INO, &inode);
if (retval) {
- com_err("ext2fs_read_inode", retval,
+ com_err("ext2fs_read_inode", retval, "%s",
_("while reading root inode"));
exit(1);
}
retval = ext2fs_write_new_inode(fs, EXT2_ROOT_INO, &inode);
if (retval) {
- com_err("ext2fs_write_inode", retval,
+ com_err("ext2fs_write_inode", retval, "%s",
_("while setting root inode ownership"));
exit(1);
}
fs->umask = 077;
retval = ext2fs_mkdir(fs, EXT2_ROOT_INO, 0, name);
if (retval) {
- com_err("ext2fs_mkdir", retval,
+ com_err("ext2fs_mkdir", retval, "%s",
_("while creating /lost+found"));
exit(1);
}
retval = ext2fs_lookup(fs, EXT2_ROOT_INO, name, strlen(name), 0, &ino);
if (retval) {
- com_err("ext2_lookup", retval,
+ com_err("ext2_lookup", retval, "%s",
_("while looking up /lost+found"));
exit(1);
}
break;
retval = ext2fs_expand_dir(fs, ino);
if (retval) {
- com_err("ext2fs_expand_dir", retval,
+ com_err("ext2fs_expand_dir", retval, "%s",
_("while expanding /lost+found"));
exit(1);
}
ext2fs_inode_alloc_stats2(fs, EXT2_BAD_INO, +1, 0);
retval = ext2fs_update_bb_inode(fs, bb_list);
if (retval) {
- com_err("ext2fs_update_bb_inode", retval,
+ com_err("ext2fs_update_bb_inode", retval, "%s",
_("while setting bad block inode"));
exit(1);
}
retval = ext2fs_create_journal_superblock(fs,
ext2fs_blocks_count(fs->super), 0, &buf);
if (retval) {
- com_err("create_journal_dev", retval,
+ com_err("create_journal_dev", retval, "%s",
_("while initializing journal superblock"));
exit(1);
}
fs->super->s_first_data_block+1,
1, buf);
if (retval) {
- com_err("create_journal_dev", retval,
+ com_err("create_journal_dev", retval, "%s",
_("while writing journal superblock"));
exit(1);
}
return;
}
- printf(_("Superblock backups stored on blocks: "));
+ printf("%s", _("Superblock backups stored on blocks: "));
group_block = s->s_first_data_block;
col_left = 0;
for (i = 1; i < fs->group_desc_count; i++) {
len = strlen(opts);
buf = malloc(len+1);
if (!buf) {
- fprintf(stderr,
+ fprintf(stderr, "%s",
_("Couldn't allocate memory to parse options!\n"));
exit(1);
}
continue;
}
if (resize <= ext2fs_blocks_count(param)) {
- fprintf(stderr,
+ fprintf(stderr, "%s",
_("The resize maximum must be greater "
"than the filesystem size.\n"));
r_usage++;
if (rsv_gdb > 0) {
if (param->s_rev_level == EXT2_GOOD_OLD_REV) {
- fprintf(stderr,
+ fprintf(stderr, "%s",
_("On-line resizing not supported with revision 0 filesystems\n"));
free(buf);
exit(1);
"%s filesystem type.\n"), ext_type);
if (!strcmp(ext_type, "ext3") || !strcmp(ext_type, "ext4") ||
!strcmp(ext_type, "ext4dev")) {
- printf(_("You probably need to install an updated "
- "mke2fs.conf file.\n\n"));
+ printf("%s", _("You probably need to install an "
+ "updated mke2fs.conf file.\n\n"));
}
if (!force) {
- printf(_("Aborting...\n"));
+ printf("%s", _("Aborting...\n"));
exit(1);
}
}
pathlen += strlen(oldpath);
newpath = malloc(pathlen);
if (!newpath) {
- fprintf(stderr, _("Couldn't allocate memory for new PATH.\n"));
+ fprintf(stderr, "%s",
+ _("Couldn't allocate memory for new PATH.\n"));
exit(1);
}
strcpy(newpath, PATH_SET);
direct_io = 1;
break;
case 'R':
- com_err(program_name, 0,
+ com_err(program_name, 0, "%s",
_("'-R' is deprecated, use '-E' instead"));
/* fallthrough */
case 'E':
case 'g':
fs_param.s_blocks_per_group = strtoul(optarg, &tmp, 0);
if (*tmp) {
- com_err(program_name, 0,
- _("Illegal number for blocks per group"));
+ com_err(program_name, 0, "%s",
+ _("Illegal number for blocks per group"));
exit(1);
}
if ((fs_param.s_blocks_per_group % 8) != 0) {
- com_err(program_name, 0,
+ com_err(program_name, 0, "%s",
_("blocks per group must be multiple of 8"));
exit(1);
}
case 'G':
flex_bg_size = strtoul(optarg, &tmp, 0);
if (*tmp) {
- com_err(program_name, 0,
+ com_err(program_name, 0, "%s",
_("Illegal number for flex_bg size"));
exit(1);
}
if (flex_bg_size < 1 ||
(flex_bg_size & (flex_bg_size-1)) != 0) {
- com_err(program_name, 0,
+ com_err(program_name, 0, "%s",
_("flex_bg size must be a power of 2"));
exit(1);
}
parse_journal_opts(optarg);
break;
case 'K':
- fprintf(stderr, _("Warning: -K option is deprecated and "
- "should not be used anymore. Use "
- "\'-E nodiscard\' extended option "
- "instead!\n"));
+ fprintf(stderr, "%s",
+ _("Warning: -K option is deprecated and "
+ "should not be used anymore. Use "
+ "\'-E nodiscard\' extended option "
+ "instead!\n"));
discard = 0;
break;
case 'l':
bad_blocks_filename = realloc(bad_blocks_filename,
strlen(optarg) + 1);
if (!bad_blocks_filename) {
- com_err(program_name, ENOMEM,
+ com_err(program_name, ENOMEM, "%s",
_("in malloc for bad_blocks_filename"));
exit(1);
}
break;
case 't':
if (fs_type) {
- com_err(program_name, 0,
+ com_err(program_name, 0, "%s",
_("The -t option may only be used once"));
exit(1);
}
break;
case 'T':
if (usage_types) {
- com_err(program_name, 0,
+ com_err(program_name, 0, "%s",
_("The -T option may only be used once"));
exit(1);
}
&dev_size);
if (retval && (retval != EXT2_ET_UNIMPLEMENTED)) {
- com_err(program_name, retval,
+ com_err(program_name, retval, "%s",
_("while trying to determine filesystem size"));
exit(1);
}
if (!fs_blocks_count) {
if (retval == EXT2_ET_UNIMPLEMENTED) {
- com_err(program_name, 0,
+ com_err(program_name, 0, "%s",
_("Couldn't determine device size; you "
"must specify\nthe size of the "
"filesystem\n"));
exit(1);
} else {
if (dev_size == 0) {
- com_err(program_name, 0,
+ com_err(program_name, 0, "%s",
_("Device size reported to be zero. "
"Invalid partition specified, or\n\t"
"partition table wasn't reread "
EXT2_BLOCK_SIZE(&fs_param))-1));
}
} else if (!force && (fs_blocks_count > dev_size)) {
- com_err(program_name, 0,
+ com_err(program_name, 0, "%s",
_("Filesystem larger than apparent device size."));
proceed_question();
}
fs_blocks_count ? fs_blocks_count : dev_size,
argv[0]);
if (!fs_types) {
- fprintf(stderr, _("Failed to parse fs types list\n"));
+ fprintf(stderr, "%s", _("Failed to parse fs types list\n"));
exit(1);
}
/* Get the hardware sector sizes, if available */
retval = ext2fs_get_device_sectsize(device_name, &lsector_size);
if (retval) {
- com_err(program_name, retval,
+ com_err(program_name, retval, "%s",
_("while trying to determine hardware sector size"));
exit(1);
}
retval = ext2fs_get_device_phys_sectsize(device_name, &psector_size);
if (retval) {
- com_err(program_name, retval,
+ com_err(program_name, retval, "%s",
_("while trying to determine physical sector size"));
exit(1);
}
fs_blocks_count /= (blocksize / 1024);
} else {
if (blocksize < lsector_size) { /* Impossible */
- com_err(program_name, EINVAL,
+ com_err(program_name, EINVAL, "%s",
_("while setting blocksize; too small "
"for device\n"));
exit(1);
if (r_opt == EXT2_GOOD_OLD_REV &&
(fs_param.s_feature_compat || fs_param.s_feature_incompat ||
fs_param.s_feature_ro_compat)) {
- fprintf(stderr, _("Filesystem features not supported "
- "with revision 0 filesystems\n"));
+ fprintf(stderr, "%s", _("Filesystem features not supported "
+ "with revision 0 filesystems\n"));
exit(1);
}
if (s_opt > 0) {
if (r_opt == EXT2_GOOD_OLD_REV) {
- fprintf(stderr, _("Sparse superblocks not supported "
+ fprintf(stderr, "%s",
+ _("Sparse superblocks not supported "
"with revision 0 filesystems\n"));
exit(1);
}
if (journal_size != 0) {
if (r_opt == EXT2_GOOD_OLD_REV) {
- fprintf(stderr, _("Journals not supported "
- "with revision 0 filesystems\n"));
+ fprintf(stderr, "%s", _("Journals not supported with "
+ "revision 0 filesystems\n"));
exit(1);
}
fs_param.s_feature_compat |=
/* Check the user's mkfs options for 64bit */
if ((fs_param.s_feature_incompat & EXT4_FEATURE_INCOMPAT_64BIT) &&
!(fs_param.s_feature_incompat & EXT3_FEATURE_INCOMPAT_EXTENTS)) {
- printf(_("Extents MUST be enabled for a 64-bit filesystem. "
- "Pass -O extents to rectify.\n"));
+ printf("%s", _("Extents MUST be enabled for a 64-bit "
+ "filesystem. Pass -O extents to rectify.\n"));
exit(1);
}
int_log2(cluster_size >> EXT2_MIN_CLUSTER_LOG_SIZE);
if (fs_param.s_log_cluster_size &&
fs_param.s_log_cluster_size < fs_param.s_log_block_size) {
- com_err(program_name, 0,
+ com_err(program_name, 0, "%s",
_("The cluster size may not be "
"smaller than the block size.\n"));
exit(1);
}
} else if (cluster_size) {
- com_err(program_name, 0,
+ com_err(program_name, 0, "%s",
_("specifying a cluster size requires the "
"bigalloc feature"));
exit(1);
/* Can't support bigalloc feature without extents feature */
if ((fs_param.s_feature_ro_compat & EXT4_FEATURE_RO_COMPAT_BIGALLOC) &&
!(fs_param.s_feature_incompat & EXT3_FEATURE_INCOMPAT_EXTENTS)) {
- com_err(program_name, 0,
+ com_err(program_name, 0, "%s",
_("Can't support bigalloc feature without "
"extents feature"));
exit(1);
if ((fs_param.s_feature_incompat & EXT2_FEATURE_INCOMPAT_META_BG) &&
(fs_param.s_feature_compat & EXT2_FEATURE_COMPAT_RESIZE_INODE)) {
- fprintf(stderr, _("The resize_inode and meta_bg features "
- "are not compatible.\n"
- "They can not be both enabled "
- "simultaneously.\n"));
+ fprintf(stderr, "%s", _("The resize_inode and meta_bg "
+ "features are not compatible.\n"
+ "They can not be both enabled "
+ "simultaneously.\n"));
exit(1);
}
if (!quiet &&
(fs_param.s_feature_ro_compat & EXT4_FEATURE_RO_COMPAT_BIGALLOC))
- fprintf(stderr, _("\nWarning: the bigalloc feature is still "
- "under development\n"
+ fprintf(stderr, "%s", _("\nWarning: the bigalloc feature is "
+ "still under development\n"
"See https://ext4.wiki.kernel.org/"
"index.php/Bigalloc for more information\n\n"));
if (!quiet &&
(fs_param.s_feature_ro_compat & EXT4_FEATURE_RO_COMPAT_QUOTA))
- fprintf(stderr, _("\nWarning: the quota feature is still "
- "under development\n"
+ fprintf(stderr, "%s", _("\nWarning: the quota feature is "
+ "still under development\n"
"See https://ext4.wiki.kernel.org/"
"index.php/Quota for more information\n\n"));
*/
if ((fs_param.s_feature_compat & EXT2_FEATURE_COMPAT_RESIZE_INODE) &&
!(fs_param.s_feature_ro_compat&EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER)) {
- com_err(program_name, 0,
+ com_err(program_name, 0, "%s",
_("reserved online resize blocks not supported "
"on non-sparse filesystem"));
exit(1);
if (fs_param.s_blocks_per_group) {
if (fs_param.s_blocks_per_group < 256 ||
fs_param.s_blocks_per_group > 8 * (unsigned) blocksize) {
- com_err(program_name, 0,
+ com_err(program_name, 0, "%s",
_("blocks per group count out of range"));
exit(1);
}
if (flex_bg_size) {
if (!(fs_param.s_feature_incompat &
EXT4_FEATURE_INCOMPAT_FLEX_BG)) {
- com_err(program_name, 0,
+ com_err(program_name, 0, "%s",
_("Flex_bg feature not enabled, so "
"flex_bg size may not be specified"));
exit(1);
if (free_tdb_dir)
free(tdb_dir);
free(tdb_file);
- com_err(program_name, retval,
+ com_err(program_name, retval, "%s",
_("while trying to setup undo file\n"));
return retval;
}
flags |= EXT2_FLAG_PRINT_PROGRESS;
retval = ext2fs_initialize(device_name, flags, &fs_param, io_ptr, &fs);
if (retval) {
- com_err(device_name, retval, _("while setting up superblock"));
+ com_err(device_name, retval, "%s",
+ _("while setting up superblock"));
exit(1);
}
fs->progress_ops = &ext2fs_numeric_progress_ops;
retval = mke2fs_discard_device(fs);
if (!retval && io_channel_discard_zeroes_data(fs->io)) {
if (verbose)
- printf(_("Discard succeeded and will return 0s "
- " - skipping inode table wipe\n"));
+ printf("%s",
+ _("Discard succeeded and will return "
+ "0s - skipping inode table wipe\n"));
lazy_itable_init = 1;
itable_zeroed = 1;
}
handle_bad_blocks(fs, bb_list);
fs->stride = fs_stride = fs->super->s_raid_stride;
if (!quiet)
- printf(_("Allocating group tables: "));
+ printf("%s", _("Allocating group tables: "));
retval = ext2fs_allocate_tables(fs);
if (retval) {
- com_err(program_name, retval,
+ com_err(program_name, retval, "%s",
_("while trying to allocate filesystem tables"));
exit(1);
}
if (!quiet)
- printf(_("done \n"));
+ printf("%s", _("done \n"));
retval = ext2fs_convert_subcluster_bitmap(fs, &fs->block_map);
if (retval) {
- com_err(program_name, retval,
+ com_err(program_name, retval, "%s",
_("\n\twhile converting subcluster bitmap"));
exit(1);
}
retval = ext2fs_create_resize_inode(fs);
if (retval) {
com_err("ext2fs_create_resize_inode", retval,
+ "%s",
_("while reserving blocks for online resize"));
exit(1);
}
exit(1);
}
if (!quiet)
- printf(_("done\n"));
+ printf("%s", _("done\n"));
ext2fs_close(jfs);
free(journal_device);
} else if ((journal_size) ||
(fs_param.s_feature_compat &
EXT3_FEATURE_COMPAT_HAS_JOURNAL)) {
if (super_only) {
- printf(_("Skipping journal creation in super-only mode\n"));
+ printf("%s", _("Skipping journal creation in super-only mode\n"));
fs->super->s_journal_inum = EXT2_JOURNAL_INO;
goto no_journal;
}
retval = ext2fs_add_journal_inode(fs, journal_blocks,
journal_flags);
if (retval) {
- com_err (program_name, retval,
- _("\n\twhile trying to create journal"));
+ com_err(program_name, retval, "%s",
+ _("\n\twhile trying to create journal"));
exit(1);
}
if (!quiet)
- printf(_("done\n"));
+ printf("%s", _("done\n"));
}
no_journal:
if (!super_only &&
fs->super->s_feature_incompat & EXT4_FEATURE_INCOMPAT_MMP) {
retval = ext2fs_mmp_init(fs);
if (retval) {
- fprintf(stderr, _("\nError while enabling multiple "
- "mount protection feature."));
+ fprintf(stderr, "%s",
+ _("\nError while enabling multiple "
+ "mount protection feature."));
exit(1);
}
if (!quiet)
create_quota_inodes(fs);
if (!quiet)
- printf(_("Writing superblocks and "
+ printf("%s", _("Writing superblocks and "
"filesystem accounting information: "));
checkinterval = fs->super->s_checkinterval;
max_mnt_count = fs->super->s_max_mnt_count;
retval = ext2fs_close(fs);
if (retval) {
- fprintf(stderr,
+ fprintf(stderr, "%s",
_("\nWarning, had trouble writing out superblocks."));
} else if (!quiet) {
- printf(_("done\n\n"));
+ printf("%s", _("done\n\n"));
if (!getenv("MKE2FS_SKIP_CHECK_MSG"))
print_check_message(max_mnt_count, checkinterval);
}