All of lore.kernel.org
 help / color / mirror / Atom feed
From: Suresh Jayaraman <sjayaraman-IBi9RG/b67k@public.gmane.org>
To: stable-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	Greg KH <gregkh-l3A5Bk7waGM@public.gmane.org>
Cc: Pavel Shilovsky
	<piastryyy-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Steve French <smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	linux-cifs <linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
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	[thread overview]
Message-ID: <4ED8AE80.7030008@suse.com> (raw)
In-Reply-To: <CAKywueSU2qMuQEFJ573i4cR_a1L_n9=2eH_7f8yvaqUWDXwB_Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On 12/02/2011 02:35 PM, Pavel Shilovsky wrote:
> 2011/12/2 Suresh Jayaraman <sjayaraman-IBi9RG/b67k@public.gmane.org>:
>>>>  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 <sjayaraman-IBi9RG/b67k@public.gmane.org>

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/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
Signed-off-by: Pavel Shilovsky <piastry-7qunaywFIewox3rIn2DAYQ@public.gmane.org>
Signed-off-by: Suresh Jayaraman <sjayaraman-IBi9RG/b67k@public.gmane.org>
---
 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 "

  parent reply	other threads:[~2011-12-02 10:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-02  5:38 [PATCH] cifs: fix cifs stable patch cifs-fix-oplock-break-handling-try-2.patch Suresh Jayaraman
     [not found] ` <4ED86453.2040007-IBi9RG/b67k@public.gmane.org>
2011-12-02  7:08   ` Pavel Shilovsky
     [not found]     ` <CAKywueSx7efJWX7N8v+KVxRfAsgdFyMx6rc2F7+izpsC-Hcrbg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-12-02  7:20       ` Suresh Jayaraman
     [not found]         ` <4ED87C50.6010507-IBi9RG/b67k@public.gmane.org>
2011-12-02  9:05           ` Pavel Shilovsky
     [not found]             ` <CAKywueSU2qMuQEFJ573i4cR_a1L_n9=2eH_7f8yvaqUWDXwB_Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-12-02 10:54               ` Suresh Jayaraman [this message]
     [not found]                 ` <4ED8AE80.7030008-IBi9RG/b67k@public.gmane.org>
2011-12-05 21:40                   ` Patch "cifs: fix cifs stable patch cifs-fix-oplock-break-handling-try-2.patch" has been added to the 2.6.32-longterm tree gregkh-l3A5Bk7waGM

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=4ED8AE80.7030008@suse.com \
    --to=sjayaraman-ibi9rg/b67k@public.gmane.org \
    --cc=gregkh-l3A5Bk7waGM@public.gmane.org \
    --cc=linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=piastryyy-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=stable-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.