diff options
| author | Rajasi Mandal <rajasimandal@microsoft.com> | 2026-04-09 09:59:19 +0000 |
|---|---|---|
| committer | Steve French <stfrench@microsoft.com> | 2026-04-13 09:14:54 -0500 |
| commit | 4248ed1013816f97f4029d06b16c67a6e43d0668 (patch) | |
| tree | 5e2a0c352bcac16581be7325984ffbd1e10fc3bb | |
| parent | dc0325b0aafe28fa7a00c49aec97095ccae0952b (diff) | |
smb: client: allow both 'lease' and 'nolease' mount options
Change the nolease mount option from fsparam_flag() to fsparam_flag_no()
so that both 'lease' and 'nolease' are accepted as valid mount options.
Previously, only 'nolease' was recognized. Passing 'lease' would fail
with an unknown parameter error (or be silently ignored with 'sloppy').
With this change:
- 'nolease' disables lease requests (same behavior as before)
- 'lease' explicitly enables lease requests
This also renames the enum value from Opt_nolease to Opt_lease and uses
result.negated to set ctx->no_lease, which is the standard pattern used
by other flag_no options in the cifs mount option parser.
Signed-off-by: Rajasi Mandal <rajasimandal@microsoft.com>
Reviewed-by: Meetakshi Setiya <msetiya@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
| -rw-r--r-- | fs/smb/client/fs_context.c | 6 | ||||
| -rw-r--r-- | fs/smb/client/fs_context.h | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/fs/smb/client/fs_context.c b/fs/smb/client/fs_context.c index 3f0faae99ed5..b9544eb0381b 100644 --- a/fs/smb/client/fs_context.c +++ b/fs/smb/client/fs_context.c @@ -80,7 +80,7 @@ const struct fs_parameter_spec smb3_fs_parameters[] = { fsparam_flag_no("forcegid", Opt_forcegid), fsparam_flag("noblocksend", Opt_noblocksend), fsparam_flag("noautotune", Opt_noautotune), - fsparam_flag("nolease", Opt_nolease), + fsparam_flag_no("lease", Opt_lease), fsparam_flag_no("hard", Opt_hard), fsparam_flag_no("soft", Opt_soft), fsparam_flag_no("perm", Opt_perm), @@ -1340,8 +1340,8 @@ static int smb3_fs_context_parse_param(struct fs_context *fc, case Opt_noautotune: ctx->noautotune = 1; break; - case Opt_nolease: - ctx->no_lease = 1; + case Opt_lease: + ctx->no_lease = result.negated; break; case Opt_nosparse: ctx->no_sparse = 1; diff --git a/fs/smb/client/fs_context.h b/fs/smb/client/fs_context.h index 0b64fcb5d302..a80a5caff23c 100644 --- a/fs/smb/client/fs_context.h +++ b/fs/smb/client/fs_context.h @@ -102,7 +102,7 @@ enum cifs_param { Opt_forcegid, Opt_noblocksend, Opt_noautotune, - Opt_nolease, + Opt_lease, Opt_nosparse, Opt_hard, Opt_soft, |
