[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <175182663113.1984706.10460295274868313866.stgit@frogsfrogsfrogs>
Date: Sun, 06 Jul 2025 11:32:50 -0700
From: "Darrick J. Wong" <djwong@...nel.org>
To: tytso@....edu
Cc: linux-ext4@...r.kernel.org
Subject: [PATCH 8/8] fuse2fs: don't try to mount after option parsing errors
From: Darrick J. Wong <djwong@...nel.org>
Actually check the outcome of parsing CLI options before trying to
mount.
Signed-off-by: "Darrick J. Wong" <djwong@...nel.org>
---
misc/fuse2fs.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/misc/fuse2fs.c b/misc/fuse2fs.c
index ff8aa023d1c555..ab3efea66d3def 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]);
Powered by blists - more mailing lists