From mboxrd@z Thu Jan 1 00:00:00 1970 From: Suresh Jayaraman Subject: Re: [PATCH] cifs: fix cifs stable patch cifs-fix-oplock-break-handling-try-2.patch Date: Fri, 02 Dec 2011 16:24:56 +0530 Message-ID: <4ED8AE80.7030008@suse.com> References: <4ED86453.2040007@suse.com> <4ED87C50.6010507@suse.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Pavel Shilovsky , Steve French , linux-cifs To: stable-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, Greg KH Return-path: In-Reply-To: Sender: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-ID: On 12/02/2011 02:35 PM, Pavel Shilovsky wrote: > 2011/12/2 Suresh Jayaraman : >>>> fs/cifs/misc.c | 3 +++ >>>> 1 files changed, 3 insertions(+), 0 deletions(-) >>>> >>>> diff --git a/fs/cifs/misc.c b/fs/cifs/misc.c >>>> index d27d4ec..7055827 100644 >>>> --- a/fs/cifs/misc.c >>>> +++ b/fs/cifs/misc.c >>>> @@ -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)" >>> >>>> + 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) > Ok thanks. Here's the updated patch. Greg, could you please consider this patch for next 2.6.32.y From: Suresh Jayaraman 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 Signed-off-by: Pavel Shilovsky Signed-off-by: Suresh Jayaraman --- fs/cifs/misc.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/fs/cifs/misc.c b/fs/cifs/misc.c index d27d4ec..95b82e8 100644 --- a/fs/cifs/misc.c +++ b/fs/cifs/misc.c @@ -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 "