From: Darrick J. Wong Date: Sun, 6 Jul 2025 18:32:50 +0000 (-0700) Subject: fuse2fs: don't try to mount after option parsing errors X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e7774d8fef39d16eb96f1e55cf2f33d3acb14d88;p=thirdparty%2Fe2fsprogs.git fuse2fs: don't try to mount after option parsing errors Actually check the outcome of parsing CLI options before trying to mount. Signed-off-by: Darrick J. Wong Link: https://lore.kernel.org/r/175182663113.1984706.10460295274868313866.stgit@frogsfrogsfrogs Signed-off-by: Theodore Ts'o --- diff --git a/misc/fuse2fs.c b/misc/fuse2fs.c index ff8aa023..ab3efea6 100644 --- a/misc/fuse2fs.c +++ b/misc/fuse2fs.c @@ -4407,14 +4407,16 @@ int main(int argc, char *argv[]) FILE *orig_stderr = stderr; char *logfile; char extra_args[BUFSIZ]; - int ret = 0; + int ret; int flags = EXT2_FLAG_64BITS | EXT2_FLAG_THREADS | EXT2_FLAG_EXCLUSIVE | EXT2_FLAG_RW; memset(&fctx, 0, sizeof(fctx)); fctx.magic = FUSE2FS_MAGIC; - fuse_opt_parse(&args, &fctx, fuse2fs_opts, fuse2fs_opt_proc); + ret = fuse_opt_parse(&args, &fctx, fuse2fs_opts, fuse2fs_opt_proc); + if (ret) + exit(1); if (fctx.device == NULL) { fprintf(stderr, "Missing ext4 device/image\n"); fprintf(stderr, "See '%s -h' for usage\n", argv[0]);