Add a way to pass arbitrary mount options to fsck

This commit is contained in:
Kent Overstreet 2019-08-28 13:43:18 -04:00
parent 92fc14824f
commit 7f35a52029

View File

@ -30,7 +30,7 @@ int cmd_fsck(int argc, char *argv[])
opt_set(opts, fsck, true); opt_set(opts, fsck, true);
opt_set(opts, fix_errors, FSCK_OPT_ASK); opt_set(opts, fix_errors, FSCK_OPT_ASK);
while ((opt = getopt(argc, argv, "apynfvh")) != -1) while ((opt = getopt(argc, argv, "apynfo:vh")) != -1)
switch (opt) { switch (opt) {
case 'a': /* outdated alias for -p */ case 'a': /* outdated alias for -p */
case 'p': case 'p':
@ -46,6 +46,11 @@ int cmd_fsck(int argc, char *argv[])
case 'f': case 'f':
/* force check, even if filesystem marked clean: */ /* force check, even if filesystem marked clean: */
break; break;
case 'o':
ret = bch2_parse_mount_opts(&opts, optarg);
if (ret)
return ret;
break;
case 'v': case 'v':
opt_set(opts, verbose, true); opt_set(opts, verbose, true);
break; break;