Re: [nfsv4] NFSv4 Referral handling by client

Rahul Shah <shahrahulb@gmail.com> Sat, 15 November 2014 02:40 UTC

Return-Path: <shahrahulb@gmail.com>
X-Original-To: nfsv4@ietfa.amsl.com
Delivered-To: nfsv4@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 81A3C1A015F for <nfsv4@ietfa.amsl.com>; Fri, 14 Nov 2014 18:40:27 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.999
X-Spam-Level:
X-Spam-Status: No, score=-1.999 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, SPF_PASS=-0.001] autolearn=ham
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id F6ZAAE-8I5PF for <nfsv4@ietfa.amsl.com>; Fri, 14 Nov 2014 18:40:25 -0800 (PST)
Received: from mail-wg0-x232.google.com (mail-wg0-x232.google.com [IPv6:2a00:1450:400c:c00::232]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id CCFC81A0276 for <nfsv4@ietf.org>; Fri, 14 Nov 2014 18:40:24 -0800 (PST)
Received: by mail-wg0-f50.google.com with SMTP id k14so2750466wgh.37 for <nfsv4@ietf.org>; Fri, 14 Nov 2014 18:40:23 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=CLgmMIV7sRzQmHEw3treR11O+b8jLqnaAsanXK8I39o=; b=aLhbeYoSeuHOTGv6ErMsMi2SYn8Bnebl6NhzHr+R1pWqFtCTqy5DTeHHNnenFIOCyG 4B7Wx1OmbxI08nPjl3KpppQEOmdTxUuNfuzL1KCFS+wr8K7NP4EI80uCoLUq3kMLfip0 mdNMA22S0LVte8BmSXI6TipKEqSqPDYziTQ43wVhYWET6KruLAHtaLp0E/6qn9cbxrhH krdKO2KQsbzvjIzz/r+Kz70cn1XPXAhXce9KRhHKVpRJzmXu1ryG1tUE4m75EY3BTRPR 1FBI6d2ro8EvCCTMwcT542VUHe2oNhZTCIgCdW0zPIQ1lnDj2J1WHVLQmfj2x3a24T7g 9Wzw==
MIME-Version: 1.0
X-Received: by 10.194.184.75 with SMTP id es11mr18866417wjc.35.1416019223518; Fri, 14 Nov 2014 18:40:23 -0800 (PST)
Received: by 10.216.234.66 with HTTP; Fri, 14 Nov 2014 18:40:23 -0800 (PST)
In-Reply-To: <CAABAsM4=m-sDgQbXyEcu5cpLT+rWnRg=gPdGDXRtCAJr-dR+ig@mail.gmail.com>
References: <CAHVwH2G=L_V_hZ1mY+qP68bhMGLy=v3wLG4V4Ny4NNZBFgn69w@mail.gmail.com> <CAABAsM4=m-sDgQbXyEcu5cpLT+rWnRg=gPdGDXRtCAJr-dR+ig@mail.gmail.com>
Date: Fri, 14 Nov 2014 21:40:23 -0500
Message-ID: <CAHVwH2FhT_HrFDRL3sTcCdori3o6=-adigQ057yB6XTLDA8Xwg@mail.gmail.com>
From: Rahul Shah <shahrahulb@gmail.com>
To: Trond Myklebust <trondmy@gmail.com>
Content-Type: multipart/alternative; boundary="047d7b6da766d023cf0507dcaa26"
Archived-At: http://mailarchive.ietf.org/arch/msg/nfsv4/uGRtlWw5_He-Httk4SZMhQaIlLg
Cc: "nfsv4@ietf.org" <nfsv4@ietf.org>
Subject: Re: [nfsv4] NFSv4 Referral handling by client
X-BeenThere: nfsv4@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: NFSv4 Working Group <nfsv4.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/nfsv4>, <mailto:nfsv4-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/nfsv4/>
List-Post: <mailto:nfsv4@ietf.org>
List-Help: <mailto:nfsv4-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/nfsv4>, <mailto:nfsv4-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sat, 15 Nov 2014 02:40:27 -0000

Hi Trond,

Thanks for your reply. I understand the behavior of 8.3.2 with respect to
READDIR.
However If you look closely in my case TEST_2, Client has performed READDIR
 in "step 3" while the filehandle was still PRESENT at the server. Once
server returns the present filehandle to client, then after few seconds I
am setting a referral on the directory "c" at server side.
So basically client has stale filehandle. In step 6 when the client does
"cd c", it is sending
PUTFH (of "c" it got fh from previous READDIR), ACCESS (of "c"), GETATTR
(without fs_locations)

Even though I return NFS4ERR_MOVED for ACCESS, client never attempted to
send new GETFH or GETATTR (with fs_locations) to the server.

If you want, I can send you the pcap for both the above cases.

Thanks,
Rahul


On Fri, Nov 14, 2014 at 8:26 PM, Trond Myklebust <trondmy@gmail.com> wrote:

> On Fri, Nov 14, 2014 at 7:14 PM, Rahul Shah <shahrahulb@gmail.com> wrote:
> > I am working NFSv4 referral implementation on the server side and noticed
> > one of the occasion client never requested GETATTR with fs_locations even
> > though server returns NFS4ERR_MOVED.
> >
> > I am running two set of test.
> >
> > TEST_1: works as expected and client is redirected to remote server.
> >
> > 1) Client mounts to server_a
> > 2) cd /a/b
> > 3) From the server set referrals on directory /a/b/c and point it to some
> > remote server
> > 4) cd "c"
> > 5) What I observed is, client sends PUTFH (of "b"), LOOKUP (of "c"),
> GETFH,
> > GETATTR
> > 6) Server returns NFS4ERR_MOVED for GETFH
> > 7) Clients sends PUTFH (of "b"), LOOKUP (of "c"), GETATTR (requesting
> > fs_locations)
> > 8) Server returns all referral information and client happily connects to
> > server_b
> >
> > TEST_2 : Client never requests fs_locations
> >
> > 1) Client mounts to some path on server_a
> > 2) cd /a/b
> > 3) READDIR "ls" on /a/b which returns filehandle of "c"
> > 4) From the server set referrals on directory /a/b/c and point it to some
> > remote server
> > 5) cd to "c"
> > 5) While catching the tcpdumps, I observed client sending requests
> >     PUTFH (of "c" it got fh from previous READDIR), ACCESS (of "c"),
> GETATTR
> > (without fs_locations)
> > As per RFC 3530, NFS4ERR_MOVED is a valid return code from ACCESS.
> >
> > From the server I tried returning NFS4ERR_MOVED for ACCESS. Client just
> > gives up  and NEVER sends  PUTFH (of "c"), LOOKUP (of "c"), GETATTR
> > (requesting fs_locations)
> > I also tried returning NFS4ERR_MOVED for PUTFH. Client again gives up
> and
> > NEVER sends  PUTFH (of "c"), LOOKUP (of "c"), GETATTR (requesting
> > fs_locations)
> >
>
> A full description of how NFSv4 referrals are expected to work can be
> found in the section on "absent filesystems" in the latest draft of
> RFC3530bis:
>     http://tools.ietf.org/html/draft-ietf-nfsv4-rfc3530bis-34#section-8.2
>
> If you read through that, you will see that the most likely cause of
> the client's confusion is that your server returned a filehandle in
> the READDIR operation. Most existing clients expect that a server that
> has an absent filesystem will instead implement the behaviour
> described in
>
> http://tools.ietf.org/html/draft-ietf-nfsv4-rfc3530bis-34#section-8.3.2
>
> Cheers
>   Trond
>