Skip to content

Commit 4248ed1

Browse files
rajasi3010smfrench
authored andcommitted
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>
1 parent dc0325b commit 4248ed1

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

fs/smb/client/fs_context.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ const struct fs_parameter_spec smb3_fs_parameters[] = {
8080
fsparam_flag_no("forcegid", Opt_forcegid),
8181
fsparam_flag("noblocksend", Opt_noblocksend),
8282
fsparam_flag("noautotune", Opt_noautotune),
83-
fsparam_flag("nolease", Opt_nolease),
83+
fsparam_flag_no("lease", Opt_lease),
8484
fsparam_flag_no("hard", Opt_hard),
8585
fsparam_flag_no("soft", Opt_soft),
8686
fsparam_flag_no("perm", Opt_perm),
@@ -1340,8 +1340,8 @@ static int smb3_fs_context_parse_param(struct fs_context *fc,
13401340
case Opt_noautotune:
13411341
ctx->noautotune = 1;
13421342
break;
1343-
case Opt_nolease:
1344-
ctx->no_lease = 1;
1343+
case Opt_lease:
1344+
ctx->no_lease = result.negated;
13451345
break;
13461346
case Opt_nosparse:
13471347
ctx->no_sparse = 1;

fs/smb/client/fs_context.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ enum cifs_param {
102102
Opt_forcegid,
103103
Opt_noblocksend,
104104
Opt_noautotune,
105-
Opt_nolease,
105+
Opt_lease,
106106
Opt_nosparse,
107107
Opt_hard,
108108
Opt_soft,

0 commit comments

Comments
 (0)