public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Mi Jinlong <mijinlong@cn.fujitsu.com>
To: "Trond.Myklebust" <trond.myklebust@fys.uio.no>
Cc: NFSv3 list <linux-nfs@vger.kernel.org>,
	bfields@fieldses.org, mingo@elte.hu
Subject: [RFC] NLM server can not process retransmited request correctly
Date: Mon, 02 Nov 2009 17:28:02 +0800	[thread overview]
Message-ID: <4AEEA622.6000705@cn.fujitsu.com> (raw)

Hi Trond et al:

When i test the nfslock of NFSv3 at RHEL5.3GA (kernel: 2.6.18-128.el5),
NLM server can not process client's retransmited request correctly.

Steps of my test likes followed:
           client                          server
             |                                |
      step1  |           open file            |
      open   |------------------------------->|
             |              ok                |
             |<-------------------------------|
             |                                | step2
             |                             -> | <-  service nfslock stop
             |                                |
      step3  | WL1: write lock request{0, 0}  |
      fcntl  |------------------------------->|
             |                                |
             |    WL1_re: WL1 retransmit      |
             |------------------------------->|
             |                                |
             |       WL1.reply   ENOLCK       |
             |<-------------------------------|
             |                                | step4
             |                             -> | <- service nfslock start
             |                                |
      step5  | WL2: write lock request{0, 0}  |
      fcntl  |------------------------------->|
             |                                |
             |        WL1_re.reply OK         |
             |<-------------------------------|
             |       WL2.reply EBLOCKD        |
             |<-------------------------------|
             V                                V

   Client can not acquire for write lock any more after step4.

Reason:
   Server reply ENOLCK for WL1 to client because nfslock service stoped,
   but it can not distinguish retransmited request with normal request, 
   so it reply OK for WL1_re to client after nfslock service start. But 
   fcntl client called will return when it receive WL1.reply, WL1_re.reply
   will be droped at Client. So that, the lock between client and server
   is different. When client send a some lock request to server again,
   it will get a EBLOCKD error from Server.

Suggestion:
   1. I suggest add an DRC(Duplicate request cache) for NLM.
      Because, as mentioned above, when a client send a lock request to 
      server through NLM. If server isn't reply in time, a retransmit 
      request will be send from client. 

      Maybe the retransmit request will get different reply from server
      as the lock request, the lock between client and server will different.
      So that, the DRC for NLM is necessary.

      What's your opinion ?

   2. If everybody thinks it's necessary to add it, here is some ideas in
      my opinion and some patchs implement at 2.6.32-rc5:

      a. Because the implement of NLM's DRC is same as NFS's DRC almost,
         many codes will be repeated.
         I think, could we implement a common DRC for sunrpc?
         NLM and NFS will use this DRC.

         Do you have some good ideas ?

      b. A brief description of the patch at the reply:

         [0001-Add-a-common-DRC-for-sunrpc.patch]
         Add a common DRC for sunrpc, NLM and NFS implement their DRC using it.

         [0002-Add-DRC-for-NLM-using-sunrpc-s-common-DRC.patch]
         [0003-Modify-nfs-s-DRC-to-use-sunrpc-s-common-DRC.patch]

         Particular description will be implement at corresponding patch.

Waiting for your reply ...... 

thanks,

Mi Jinlong



             reply	other threads:[~2009-11-02  9:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-02  9:28 Mi Jinlong [this message]
2009-11-02  9:35 ` [PATCH 1/3] Add a common DRC for sunrpc Mi Jinlong
2009-11-02  9:39 ` [PATCH 2/3] Add DRC for NLM using sunrpc's common DRC Mi Jinlong
2009-11-02  9:45 ` [PATCH 3/3] Modify nfs's DRC to use " Mi Jinlong
2009-11-02 20:09 ` [RFC] NLM server can not process retransmited request correctly J. Bruce Fields
2009-11-03  9:37   ` Mi Jinlong
2009-11-06 23:07     ` J. Bruce Fields

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=4AEEA622.6000705@cn.fujitsu.com \
    --to=mijinlong@cn.fujitsu.com \
    --cc=bfields@fieldses.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=trond.myklebust@fys.uio.no \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox