Linux CIFS filesystem development
 help / color / mirror / Atom feed
From: Tom Talpey <tom@talpey.com>
To: Namjae Jeon <linkinjeon@kernel.org>, linux-cifs@vger.kernel.org
Cc: smfrench@gmail.com, senozhatsky@chromium.org, atteh.mailbox@gmail.com
Subject: Re: [PATCH 1/3] ksmbd: set v2 lease version on lease upgrade
Date: Sat, 16 Dec 2023 08:37:52 -0500	[thread overview]
Message-ID: <4cdd0fbb-2afe-497c-ade3-e445c5c0ae53@talpey.com> (raw)
In-Reply-To: <20231216122938.4511-1-linkinjeon@kernel.org>

On 12/16/2023 7:29 AM, Namjae Jeon wrote:
> If file opened with v2 lease is upgraded with v1 lease, smb server

Can you elaborate on this scenario? Lease v1 is SMB2, while v2 is SMB3.
So how can the same client expect to do both? And how can the server
support that?

MS-SMB2:

> 3.2.4.3.8 Requesting a Lease on a File or a Directory
...
> If Connection.Dialect belongs to the SMB 3.x dialect family, the client MUST attach an
> SMB2_CREATE_REQUEST_LEASE_V2 create context to the request. The create context MUST be
> formatted as described in section 2.2.13.2.10 with the following values
...
> If Connection.Dialect is equal to "2.1", the client MUST attach an SMB2_CREATE_REQUEST_LEASE
> create context to the request. The create context MUST be formatted as described in section
> 2.2.13.2.8, with the LeaseState value provided by the application



Tom.

> should response v2 lease create context to client.
> This patch fix smb2.lease.v2_epoch2 test failure.
> 
> Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
> ---
>   fs/smb/server/oplock.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/fs/smb/server/oplock.c b/fs/smb/server/oplock.c
> index 562b180459a1..9a19d8b06c8c 100644
> --- a/fs/smb/server/oplock.c
> +++ b/fs/smb/server/oplock.c
> @@ -1036,6 +1036,7 @@ static void copy_lease(struct oplock_info *op1, struct oplock_info *op2)
>   	lease2->duration = lease1->duration;
>   	lease2->flags = lease1->flags;
>   	lease2->epoch = lease1->epoch++;
> +	lease2->version = lease1->version;
>   }
>   
>   static int add_lease_global_list(struct oplock_info *opinfo)

  parent reply	other threads:[~2023-12-16 13:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-16 12:29 [PATCH 1/3] ksmbd: set v2 lease version on lease upgrade Namjae Jeon
2023-12-16 12:29 ` [PATCH 2/3] ksmbd: fix potential circular locking issue in smb2_set_ea() Namjae Jeon
2023-12-16 12:29 ` [PATCH 3/3] ksmbd: don't increment epoch if current state and request state are same Namjae Jeon
2023-12-16 13:37 ` Tom Talpey [this message]
2023-12-17 23:58   ` [PATCH 1/3] ksmbd: set v2 lease version on lease upgrade Namjae Jeon
2023-12-18  1:33     ` Tom Talpey
2023-12-18  2:05       ` Namjae Jeon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4cdd0fbb-2afe-497c-ade3-e445c5c0ae53@talpey.com \
    --to=tom@talpey.com \
    --cc=atteh.mailbox@gmail.com \
    --cc=linkinjeon@kernel.org \
    --cc=linux-cifs@vger.kernel.org \
    --cc=senozhatsky@chromium.org \
    --cc=smfrench@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox