[PATCH] cifs: Clarify an if-condition in SMB2_open_init()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



(server->capabilities & SMB2_GLOBAL_CAP_LEASING) is the wrong
condition to stitch together the create contexts, what we really care
about is whether there already was a create context before the durable
one we just are about to add. This also aligns with the other cases
further down in SMB2_open_init().

Signed-off-by: Volker Lendecke <vl@xxxxxxxxx>
---
 fs/cifs/smb2pdu.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
index 0e53265e1462..5d06ecc9341b 100644
--- a/fs/cifs/smb2pdu.c
+++ b/fs/cifs/smb2pdu.c
@@ -2840,8 +2840,7 @@ SMB2_open_init(struct cifs_tcon *tcon, struct TCP_Server_Info *server,
 	}
 
 	if (*oplock == SMB2_OPLOCK_LEVEL_BATCH) {
-		/* need to set Next field of lease context if we request it */
-		if (server->capabilities & SMB2_GLOBAL_CAP_LEASING) {
+		if (n_iov > 2) {
 			struct create_context *ccontext =
 			    (struct create_context *)iov[n_iov-1].iov_base;
 			ccontext->Next =
-- 
2.30.2




[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux