All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Shilovsky <piastryyy-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Jeff Layton <jlayton-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>
Cc: Steve French <smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: CIFS data coherency problem
Date: Sat, 11 Sep 2010 11:08:15 +0400	[thread overview]
Message-ID: <AANLkTik_=xi5Engkm4Xcrk_WUaXSsSAsWUhh=M8VYWer@mail.gmail.com> (raw)
In-Reply-To: <20100910185002.73e61b8b-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org>

2010/9/11 Jeff Layton <jlayton-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>:
> So what? Why should the writer know anything about whether it succeeds
> before a flush or close occurs? POSIX does not mandate that. If you are
> able to report an error at write time, then that's fine. It's not
> required however.

We can write a data in write_end call all the time when we don't have
an oplock for writing. If we get an error we simply returned it in
from write_end and an application gets it.

> That's not how I read this:
>
> 57: server downgrades oplock on 0x0001 to level 2
> 60: client drops oplock altogether for 0x0001 (note that it replies
>    with oplock level 0)
> 65: server revokes oplock on 0x0002 altogether
> 66: client "acks" the oplock break
>
> At that point there are no more oplocks held. Why would the server need
> to send another oplock break?

It (60) is the Oplock Break acknowledge request that's sent by the
client on the server's Oplock Break Notification (57). According to
the spec (page 214, section 2.2.4.32.1 of [MS-CIFS].pdf)
NewOpLockLevel field is used by the server to indicate new oplock
level for the FID. There no words that says that this field is used by
the client in acknowledge. An acknowledge is only used to indicate
that all the dirty data and byte-range locks are flushed to the server
and doesn't bring any other information. It's my understanding of the
spec.

Even more, CIFS client does it according to the spec (file.c, line 2341):

        if (!cfile->closePend && !cfile->oplock_break_cancelled) {
                rc = CIFSSMBLock(0, cifs_sb->tcon, cfile->netfid, 0, 0, 0, 0,

LOCKING_ANDX_OPLOCK_RELEASE, false);
                cFYI(1, "Oplock release rc = %d", rc);
        }

and there is no mention of OplockLevel in CIFSSMBLock call.

So, as you can see above: there is no value that is set to OplockLevel
field of SMB_COM_LOCKING_ANDX command.

That's why I said that client1 continues keeping the level II oplock.

-- 
Best regards,
Pavel Shilovsky.

  parent reply	other threads:[~2010-09-11  7:08 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <AANLkTin2iSc=Ob3DkhARJRV7CzwRUBJSGRMUJNJM+82k@mail.gmail.com>
     [not found] ` <AANLkTin2iSc=Ob3DkhARJRV7CzwRUBJSGRMUJNJM+82k-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-09-08  6:49   ` Fwd: CIFS data coherency problem Pavel Shilovsky
     [not found]     ` <AANLkTi=_eMSC99K1a2zWpgW5nc8UArzKj2MWHaRmCXzK-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-09-08 10:32       ` Jeff Layton
     [not found]         ` <20100908063224.240b0419-4QP7MXygkU+dMjc06nkz3ljfA9RmPOcC@public.gmane.org>
2010-09-08 11:04           ` Jeff Layton
     [not found]             ` <20100908070416.1f231387-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2010-09-09 18:22               ` Pavel Shilovsky
2010-09-09 18:18           ` Pavel Shilovsky
     [not found]             ` <AANLkTinYFe6O-4ANt1VYcvEMukiis-11cDuMP2GSKZ7j-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-09-09 18:25               ` Steve French
     [not found]                 ` <AANLkTin+qiQsF_hOCvdBKtCh0n0bcd82RDOUz=h3K6gu-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-09-09 18:34                   ` Pavel Shilovsky
     [not found]                     ` <AANLkTikOR_HU934L6FKq8q2ZwcaTTOTPfaSofimK6OFH-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-09-10  0:50                       ` Steve French
     [not found]                         ` <AANLkTi=zc7G847VHqVjO7LRfLkzzSGsJURvJmH1C8gOQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-09-10  7:50                           ` Pavel Shilovsky
     [not found]                             ` <AANLkTikXWGNtuOjPbG0wAdHLuVQOVuouaUaBi4HRwSR--JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-09-10 12:15                               ` Jeff Layton
     [not found]                                 ` <20100910081549.41de32d1-4QP7MXygkU+dMjc06nkz3ljfA9RmPOcC@public.gmane.org>
2010-09-10 20:16                                   ` Pavel Shilovsky
     [not found]                                     ` <AANLkTi=5YgKzG=rXJ5MuV+R_MGkEd+2ERouUiEc8K5B8-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-09-10 22:50                                       ` Jeff Layton
     [not found]                                         ` <20100910185002.73e61b8b-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2010-09-11  7:08                                           ` Pavel Shilovsky [this message]
     [not found]                                             ` <AANLkTik_=xi5Engkm4Xcrk_WUaXSsSAsWUhh=M8VYWer-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-09-12 13:16                                               ` Jeff Layton
     [not found]                                                 ` <20100912091659.73ef9cdb-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2010-09-12 14:55                                                   ` Pavel Shilovsky
     [not found]                                                     ` <AANLkTi=gSm+=djrj796Gfjx9FiRQ7s==6DSV=DhYOk7U-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-09-12 15:40                                                       ` Jeff Layton
     [not found]                                                         ` <20100912114055.55520f0c-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2010-09-12 16:16                                                           ` Pavel Shilovsky
     [not found]                                                             ` <AANLkTi=LMy37zVnyKTX_gnf1QAqXja6vuTruVMjfRCdp-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-09-12 16:55                                                               ` Jeff Layton
     [not found]                                                                 ` <20100912125535.60c3c897-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2010-09-12 19:14                                                                   ` Pavel Shilovsky
     [not found]                                                                     ` <AANLkTi=XT_X27Cuioe_M6zMee0XQAZe+P-TLHbh6n+Yk-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-09-13  0:09                                                                       ` Jeff Layton
2010-09-12 21:19                                                       ` Steve French
     [not found]                                                         ` <AANLkTi=x6gnS=++JtjEG6KVwq4_JPLfU+pKuCYgFd+xD-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-09-13  0:15                                                           ` Jeff Layton
     [not found]                                                             ` <20100912201502.624c8f33-4QP7MXygkU+dMjc06nkz3ljfA9RmPOcC@public.gmane.org>
2010-09-13  0:37                                                               ` Steve French
     [not found]                                                                 ` <AANLkTinfnGh8-egSfoEeik_iR2=hRvUF0qk9DFTVcdU8-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-01-14 12:41                                                                   ` Pavel Shilovsky
2010-09-13  9:49                                                               ` Pavel Shilovsky

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='AANLkTik_=xi5Engkm4Xcrk_WUaXSsSAsWUhh=M8VYWer@mail.gmail.com' \
    --to=piastryyy-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=jlayton-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org \
    --cc=linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=smfrench-Re5JQEeQqe8AvxtiuMwx3w@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.