]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
smb: client: allow both 'lease' and 'nolease' mount options
authorRajasi Mandal <rajasimandal@microsoft.com>
Thu, 9 Apr 2026 09:59:19 +0000 (09:59 +0000)
committerSteve French <stfrench@microsoft.com>
Mon, 13 Apr 2026 14:14:54 +0000 (09:14 -0500)
commit4248ed1013816f97f4029d06b16c67a6e43d0668
tree5e2a0c352bcac16581be7325984ffbd1e10fc3bb
parentdc0325b0aafe28fa7a00c49aec97095ccae0952b
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>
fs/smb/client/fs_context.c
fs/smb/client/fs_context.h