Skip to contentSkip to conversation

cifs: fix cifs stable patch cifs-fix-oplock-break-handling-try-2.patch

PATCH Applied Suresh Jayaraman 3 participants 6 messages Dec 2, 2011 – Dec 5, 2011 5 messages not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cifs: fix cifs stable patch cifs-fix-oplock-break-handling-try-2.patch

The stable release 2.6.32.32 added the upstream commit 12fed00de963433128b5366a21a55808fab2f756. However, one of the hunks of the original patch seems missing from the stable backport which can be found here:
http://permalink.gmane.org/gmane.linux.kernel.stable/5676

This hunk corresponds to the change in is_valid_oplock_break() at fs/cifs/misc.c.

This patch backports the missing hunk and is against linux-2.6.32.y stable kernel.

Cc Steve French <sfrench-r/[email protected]>
Cc Pavel Shilovsky <[email protected]>

---
[PS. not very happy about the subject line and changelog.
Feel free to modify as you see fit.]

 fs/cifs/misc.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
fs/cifs/misc.c +3 -0
index d27d4ec..7055827 100644
@@ -584,6 +584,9 @@ is_valid_oplock_break(struct smb_hdr *buf, struct TCP_Server_Info *srv)
 				pCifsInode->clientCanCacheAll = false;
 				if (pSMB->OplockLevel == 0)
 					pCifsInode->clientCanCacheRead = false;
+				else if (pSMB->OplockLevel == OPLOCK_READ)
+					pCifsInode->clientCanCacheRead = true;
+
 				rc = slow_work_enqueue(&netfile->oplock_break);
 				if (rc) {
 					cERROR(1, ("failed to enqueue oplock "

A message that is not in the archive (sent off-list or not yet received): 4ED86453.2040007-IBi9RG/[email protected]

#2 lore raw

2011/12/2 Suresh Jayaraman <sjayaraman-IBi9RG/[email protected]>:

Quoted 28 lines

The stable release 2.6.32.32 added the upstream commit 12fed00de963433128b5366a21a55808fab2f756. However, one of the hunks of the original patch seems missing from the stable backport which can be found here:
  http://permalink.gmane.org/gmane.linux.kernel.stable/5676

This hunk corresponds to the change in is_valid_oplock_break() at fs/cifs/misc.c.

This patch backports the missing hunk and is against linux-2.6.32.y stable kernel.

Cc Steve French <sfrench-r/[email protected]>
Cc Pavel Shilovsky <[email protected]>

---
[PS. not very happy about the subject line and changelog. Feel free to modify as you see fit.]

 fs/cifs/misc.c |    3 +++

 1 files changed, 3 insertions(+), 0 deletions(-)
fs/cifs/misc.c +0 -0
index d27d4ec..7055827 100644

fs/cifs/misc.c is_valid_oplock_break(struct smb_hdr *buf, struct TCP_Server_Info *srv) · line 587

Quoted 4 lines
fs/cifs/misc.c +1 -0
@@ -584,6 +584,9 @@ is_valid_oplock_break(struct smb_hdr *buf, struct TCP_Server_Info *srv)
                                pCifsInode->clientCanCacheAll = false;
                                if (pSMB->OplockLevel == 0)
                                        pCifsInode->clientCanCacheRead = false;
+                               else if (pSMB->OplockLevel == OPLOCK_READ)

pSMB->OplockLevel can either be 0 or 1 here but OPLOCK_READ is 3 - this should be:
"else if (pSMB->OplockLevel)"

Quoted 5 lines
fs/cifs/misc.c +2 -0
+                                       pCifsInode->clientCanCacheRead = true;
+
                                rc = slow_work_enqueue(&netfile->oplock_break);
                                if (rc) {

                                       cERROR(1, ("failed to enqueue oplock "

Signature · 2 lines
Best regards,
Pavel Shilovsky.

A message that is not in the archive (sent off-list or not yet received): CAKywueSx7efJWX7N8v+KVxRfAsgdFyMx6rc2F7+izpsC-Hcrbg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#4 lore raw
Quoted 24 lines · Pavel Shilovsky

2011/12/2 Suresh Jayaraman <sjayaraman-IBi9RG/[email protected]>:

Quoted 23 lines

The stable release 2.6.32.32 added the upstream commit 12fed00de963433128b5366a21a55808fab2f756. However, one of the hunks of the original patch seems missing from the stable backport which can be found here:
http://permalink.gmane.org/gmane.linux.kernel.stable/5676

This hunk corresponds to the change in is_valid_oplock_break() at fs/cifs/misc.c.

This patch backports the missing hunk and is against linux-2.6.32.y stable kernel.

Cc Steve French <sfrench-r/[email protected]>
Cc Pavel Shilovsky <[email protected]>

---
[PS. not very happy about the subject line and changelog.
Feel free to modify as you see fit.]

 fs/cifs/misc.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
Quoted 15 lines

fs/cifs/misc.c is_valid_oplock_break(struct smb_hdr *buf, struct TCP_Server_Info *srv) · line 587

Quoted 9 lines
fs/cifs/misc.c +1 -0
index d27d4ec..7055827 100644
@@ -584,6 +584,9 @@ is_valid_oplock_break(struct smb_hdr *buf, struct TCP_Server_Info *srv)
                               pCifsInode->clientCanCacheAll = false;
                               if (pSMB->OplockLevel == 0)
                                       pCifsInode->clientCanCacheRead = false;
+                               else if (pSMB->OplockLevel == OPLOCK_READ)

pSMB->OplockLevel can either be 0 or 1 here but OPLOCK_READ is 3 - this should be:
"else if (pSMB->OplockLevel)"

Quoted 2 lines
fs/cifs/misc.c +2 -0
+                                       pCifsInode->clientCanCacheRead = true;
+

Hmm.. if OplockLevel is OPLOCK_EXCLUSIVE, the we should set both clientCanCacheAll and clientCanCacheRead, no?

Suresh

A message that is not in the archive (sent off-list or not yet received): 4ED87C50.6010507-IBi9RG/[email protected]

#6 lore raw

2011/12/2 Suresh Jayaraman <sjayaraman-IBi9RG/[email protected]>:

Quoted 38 lines · Pavel Shilovsky
Quoted 37 lines

2011/12/2 Suresh Jayaraman <sjayaraman-IBi9RG/[email protected]>:

Quoted 28 lines

The stable release 2.6.32.32 added the upstream commit 12fed00de963433128b5366a21a55808fab2f756. However, one of the hunks of the original patch seems missing from the stable backport which can be found here:
  http://permalink.gmane.org/gmane.linux.kernel.stable/5676

This hunk corresponds to the change in is_valid_oplock_break() at fs/cifs/misc.c.

This patch backports the missing hunk and is against linux-2.6.32.y stable kernel.

Cc Steve French <sfrench-r/[email protected]>
Cc Pavel Shilovsky <[email protected]>

---
[PS. not very happy about the subject line and changelog. Feel free to modify as you see fit.]

 fs/cifs/misc.c |    3 +++

 1 files changed, 3 insertions(+), 0 deletions(-)
fs/cifs/misc.c +0 -0
index d27d4ec..7055827 100644

fs/cifs/misc.c is_valid_oplock_break(struct smb_hdr *buf, struct TCP_Server_Info *srv) · line 587

Quoted 4 lines
fs/cifs/misc.c +1 -0
@@ -584,6 +584,9 @@ is_valid_oplock_break(struct smb_hdr *buf, struct TCP_Server_Info *srv)
                                pCifsInode->clientCanCacheAll = false;
                                if (pSMB->OplockLevel == 0)
                                        pCifsInode->clientCanCacheRead = false;
+                               else if (pSMB->OplockLevel == OPLOCK_READ)

pSMB->OplockLevel can either be 0 or 1 here but OPLOCK_READ is 3 - this should be:
"else if (pSMB->OplockLevel)"

Quoted 5 lines
Quoted 2 lines

fs/cifs/misc.c is_valid_oplock_break(struct smb_hdr *buf, struct TCP_Server_Info *srv) · line 589

Quoted 2 lines
fs/cifs/misc.c +2 -0
+                                       pCifsInode->clientCanCacheRead = true;
+

Hmm.. if OplockLevel is OPLOCK_EXCLUSIVE, the we should set both clientCanCacheAll and clientCanCacheRead, no?

OplockLevel field in the oplock break request (SMB_COM_LOCKING_ANDX command) can be:
0 - oplock downgrades to None
1 - oplock downgrades to READ.

(see http://msdn.microsoft.com/en-us/library/ee442004(v=PROT.13).aspx
for further details)

Signature · 2 lines
Best regards,
Pavel Shilovsky.

A message that is not in the archive (sent off-list or not yet received): CAKywueSU2qMuQEFJ573i4cR_a1L_n9=2eH_7f8yvaqUWDXwB_Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#8 lore raw
Quoted 23 lines · Pavel Shilovsky

2011/12/2 Suresh Jayaraman <sjayaraman-IBi9RG/[email protected]>:

Quoted 16 lines
Quoted 16 lines

fs/cifs/misc.c is_valid_oplock_break(struct smb_hdr *buf, struct TCP_Server_Info *srv) · line 587

Quoted 12 lines
 fs/cifs/misc.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
fs/cifs/misc.c +1 -0
index d27d4ec..7055827 100644
@@ -584,6 +584,9 @@ is_valid_oplock_break(struct smb_hdr *buf, struct TCP_Server_Info *srv)
                               pCifsInode->clientCanCacheAll = false;
                               if (pSMB->OplockLevel == 0)
                                       pCifsInode->clientCanCacheRead = false;
+                               else if (pSMB->OplockLevel == OPLOCK_READ)

pSMB->OplockLevel can either be 0 or 1 here but OPLOCK_READ is 3 - this should be:
"else if (pSMB->OplockLevel)"

Quoted 5 lines
Quoted 2 lines

fs/cifs/misc.c is_valid_oplock_break(struct smb_hdr *buf, struct TCP_Server_Info *srv) · line 589

Quoted 2 lines
fs/cifs/misc.c +2 -0
+                                       pCifsInode->clientCanCacheRead = true;
+

Hmm.. if OplockLevel is OPLOCK_EXCLUSIVE, the we should set both clientCanCacheAll and clientCanCacheRead, no?

Quoted 8 lines

OplockLevel field in the oplock break request (SMB_COM_LOCKING_ANDX command) can be:
0 - oplock downgrades to None
1 - oplock downgrades to READ.

(see http://msdn.microsoft.com/en-us/library/ee442004(v=PROT.13).aspx
for further details)

Ok thanks. Here's the updated patch. Greg, could you please consider this patch for next 2.6.32.y

From: Suresh Jayaraman <sjayaraman-IBi9RG/[email protected]>

The stable release 2.6.32.32 added the upstream commit 12fed00de963433128b5366a21a55808fab2f756. However, one of the hunks of the original patch seems missing from the stable backport which can be found here:
http://permalink.gmane.org/gmane.linux.kernel.stable/5676

This hunk corresponds to the change in is_valid_oplock_break() at fs/cifs/misc.c.

This patch backports the missing hunk and is against linux-2.6.32.y stable kernel.

---
 fs/cifs/misc.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
fs/cifs/misc.c +3 -0
index d27d4ec..95b82e8 100644
@@ -584,6 +584,9 @@ is_valid_oplock_break(struct smb_hdr *buf, struct TCP_Server_Info *srv)
 				pCifsInode->clientCanCacheAll = false;
 				if (pSMB->OplockLevel == 0)
 					pCifsInode->clientCanCacheRead = false;
+				else if (pSMB->OplockLevel)
+					pCifsInode->clientCanCacheRead = true;
+
 				rc = slow_work_enqueue(&netfile->oplock_break);
 				if (rc) {
 					cERROR(1, ("failed to enqueue oplock "

A message that is not in the archive (sent off-list or not yet received): 4ED8AE80.7030008-IBi9RG/[email protected]

#10 lore raw

Patch "cifs: fix cifs stable patch cifs-fix-oplock-break-handling-try-2.patch" has been added to the 2.6.32-longterm tree

This is a note to let you know that I've just added the patch titled

cifs: fix cifs stable patch cifs-fix-oplock-break-handling-try-2.patch

to the 2.6.32-longterm tree which can be found at:

    http://www.kernel.org/git/?p=linux/kernel/git/longterm/longterm-queue-2.6.32.git;a=summary

The filename of the patch is:
cifs-fix-cifs-stable-patch-cifs-fix-oplock-break-handling-try-2.patch.patch
and it can be found in the queue-2.6.32 subdirectory.

If you, or anyone else, feels it should not be added to the 2.6.32 longterm tree, please let <[email protected]> know about it.

Quoted 1 line

From sjayaraman-IBi9RG/[email protected] Mon Dec 5 13:33:36 2011

From: Suresh Jayaraman <sjayaraman-IBi9RG/[email protected]>
Date: Fri, 02 Dec 2011 16:24:56 +0530
Subject: cifs: fix cifs stable patch cifs-fix-oplock-break-handling-try-2.patch
To: [email protected], Greg KH <[email protected]>
Cc: Pavel Shilovsky <[email protected]>, Steve French <[email protected]>, linux-cifs <[email protected]>
Message-ID: <4ED8AE80.7030008-IBi9RG/[email protected]>

From: Suresh Jayaraman <sjayaraman-IBi9RG/[email protected]>

The stable release 2.6.32.32 added the upstream commit 12fed00de963433128b5366a21a55808fab2f756. However, one of the hunks of the original patch seems missing from the stable backport which can be found here:
http://permalink.gmane.org/gmane.linux.kernel.stable/5676

This hunk corresponds to the change in is_valid_oplock_break() at fs/cifs/misc.c.

This patch backports the missing hunk and is against linux-2.6.32.y stable kernel.

---
 fs/cifs/misc.c |    3 +++
 1 file changed, 3 insertions(+)
fs/cifs/misc.c +3 -0
@@ -584,6 +584,9 @@ is_valid_oplock_break(struct smb_hdr *bu
 				pCifsInode->clientCanCacheAll = false;
 				if (pSMB->OplockLevel == 0)
 					pCifsInode->clientCanCacheRead = false;
+				else if (pSMB->OplockLevel)
+					pCifsInode->clientCanCacheRead = true;
+
 				rc = slow_work_enqueue(&netfile->oplock_break);
 				if (rc) {
 					cERROR(1, ("failed to enqueue oplock "

Patches currently in longterm-queue-2.6.32 which might be from sjayaraman-IBi9RG/[email protected] are

/home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/cifs-fix-cifs-stable-patch-cifs-fix-oplock-break-handling-try-2.patch.patch