Skip to content

Commit bb05367

Browse files
namjaejeonSteve French
authored andcommitted
ksmbd: set v2 lease version on lease upgrade
If file opened with v2 lease is upgraded with v1 lease, smb server should response v2 lease create context to client. This patch fix smb2.lease.v2_epoch2 test failure. This test case assumes the following scenario: 1. smb2 create with v2 lease(R, LEASE1 key) 2. smb server return smb2 create response with v2 lease context(R, LEASE1 key, epoch + 1) 3. smb2 create with v1 lease(RH, LEASE1 key) 4. smb server return smb2 create response with v2 lease context(RH, LEASE1 key, epoch + 2) i.e. If same client(same lease key) try to open a file that is being opened with v2 lease with v1 lease, smb server should return v2 lease. Signed-off-by: Namjae Jeon <linkinjeon@kernel.org> Acked-by: Tom Talpey <tom@talpey.com> Signed-off-by: Steve French <stfrench@microsoft.com>
1 parent 516b3eb commit bb05367

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

fs/smb/server/oplock.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1036,6 +1036,7 @@ static void copy_lease(struct oplock_info *op1, struct oplock_info *op2)
10361036
lease2->duration = lease1->duration;
10371037
lease2->flags = lease1->flags;
10381038
lease2->epoch = lease1->epoch++;
1039+
lease2->version = lease1->version;
10391040
}
10401041

10411042
static int add_lease_global_list(struct oplock_info *opinfo)

0 commit comments

Comments
 (0)