static int stride_set, stripe_width_set;
static char *extended_cmd;
static unsigned long new_inode_size;
+static char *ext_mount_opts;
int journal_size, journal_flags;
char *journal_device;
"to %s (%d)\n"),
arg, hash_alg);
ext2fs_mark_super_dirty(fs);
- } else if (strcmp(token, "mount-options")) {
+ } else if (!strcmp(token, "mount_opts")) {
if (!arg) {
r_usage++;
continue;
"Extended mount options too long\n");
continue;
}
- strcpy(fs->super->s_mount_opts, arg);
- ext2fs_mark_super_dirty(fs);
+ ext_mount_opts = strdup(arg);
} else
r_usage++;
}
"and may take an argument which\n"
"\tis set off by an equals ('=') sign.\n\n"
"Valid extended options are:\n"
+ "\thash_alg=<hash algorithm>\n"
+ "\tmount_opts=<extended default mount options>\n"
"\tstride=<RAID per-disk chunk size in blocks>\n"
"\tstripe_width=<RAID stride*data disks in blocks>\n"
- "\thash_alg=<hash algorithm>\n"
"\ttest_fs\n"
"\t^test_fs\n"));
free(buf);
ext2fs_mark_super_dirty(fs);
printf(_("Setting stripe width to %d\n"), stripe_width);
}
+ if (ext_mount_opts) {
+ strncpy(fs->super->s_mount_opts, ext_mount_opts,
+ sizeof(fs->super->s_mount_opts));
+ fs->super->s_mount_opts[sizeof(fs->super->s_mount_opts)-1] = 0;
+ ext2fs_mark_super_dirty(fs);
+ printf(_("Setting extended default mount options to '%s'\n"),
+ ext_mount_opts);
+ free(ext_mount_opts);
+ }
free(device_name);
remove_error_table(&et_ext2_error_table);
return (ext2fs_close(fs) ? 1 : 0);