From ddc5d9f04d9d75ddabb6b8d35a3352db02c50e4e Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Wed, 28 Sep 2022 10:07:10 -0700 Subject: [PATCH] Allow setting orphan_scan_delay_ms option The orphan_scan_delay_ms option setting code mistakenly set the default before testing the option for -1 (not the default) to discover if multiple options had been set. This made any attempt to set fail. Initialize the option to -1 so the first set succeeds and apply the default if we don't set the value. Signed-off-by: Zach Brown --- kmod/src/options.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kmod/src/options.c b/kmod/src/options.c index 9ff18c9d..474d2b0d 100644 --- a/kmod/src/options.c +++ b/kmod/src/options.c @@ -114,7 +114,7 @@ static void init_default_options(struct scoutfs_mount_options *opts) { memset(opts, 0, sizeof(*opts)); opts->quorum_slot_nr = -1; - opts->orphan_scan_delay_ms = DEFAULT_ORPHAN_SCAN_DELAY_MS; + opts->orphan_scan_delay_ms = -1; } /* @@ -193,6 +193,9 @@ static int parse_options(struct super_block *sb, char *options, struct scoutfs_m } } + if (opts->orphan_scan_delay_ms == -1) + opts->orphan_scan_delay_ms = DEFAULT_ORPHAN_SCAN_DELAY_MS; + if (!opts->metadev_path) { scoutfs_err(sb, "Required mount option \"metadev_path\" not found"); return -EINVAL;