Re: [nfsv4] NFSv4 Referral handling by client

Trond Myklebust <trondmy@gmail.com> Sat, 15 November 2014 01:26 UTC

Return-Path: <trondmy@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 EBF0C1A00AD for <nfsv4@ietfa.amsl.com>; Fri, 14 Nov 2014 17:26:21 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2
X-Spam-Level:
X-Spam-Status: No, score=-2 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, 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 ddz6Kiq35Yp5 for <nfsv4@ietfa.amsl.com>; Fri, 14 Nov 2014 17:26:20 -0800 (PST)
Received: from mail-ie0-x234.google.com (mail-ie0-x234.google.com [IPv6:2607:f8b0:4001:c03::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id F35041A0045 for <nfsv4@ietf.org>; Fri, 14 Nov 2014 17:26:19 -0800 (PST)
Received: by mail-ie0-f180.google.com with SMTP id rl12so3684239iec.11 for <nfsv4@ietf.org>; Fri, 14 Nov 2014 17:26:19 -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=PtYJIWRLh1DoqEsYHSsoVUCixmvVGnFT0CzrnedRK1M=; b=MjKcH7pRT9YLaNNT6P1FoevKzpqHGS6bx4alucPDeKXikp0XrveciB4o25g4Ilwqpx gZFvtTUP8dKXs/exU+PgYn1y0u78jykJyM8fxC3+WbDx5UulGnzM8YJGVP9bG+oVQqD8 NfUZBkMlpO6ACpmjli31q/gvyEHQm2Lgu/UkjZPi04ALgu81I9zyCwp01Q9gfQD445gT aZWpCydeKq5UHGw5zkBaZa+H1d+Yyq6au74fSuoBDcKp7f178vZ3h1THmaTusWMSu9nZ G4PcBtP4Vff/moEzRsnfiYNS55NyMXfhk9PZcb0APACuDL+dLsPiIb1AUkt323N2fS5e i10A==
MIME-Version: 1.0
X-Received: by 10.50.131.199 with SMTP id oo7mr10014586igb.42.1416014779208; Fri, 14 Nov 2014 17:26:19 -0800 (PST)
Received: by 10.107.135.29 with HTTP; Fri, 14 Nov 2014 17:26:19 -0800 (PST)
In-Reply-To: <CAHVwH2G=L_V_hZ1mY+qP68bhMGLy=v3wLG4V4Ny4NNZBFgn69w@mail.gmail.com>
References: <CAHVwH2G=L_V_hZ1mY+qP68bhMGLy=v3wLG4V4Ny4NNZBFgn69w@mail.gmail.com>
Date: Fri, 14 Nov 2014 20:26:19 -0500
Message-ID: <CAABAsM4=m-sDgQbXyEcu5cpLT+rWnRg=gPdGDXRtCAJr-dR+ig@mail.gmail.com>
From: Trond Myklebust <trondmy@gmail.com>
To: Rahul Shah <shahrahulb@gmail.com>
Content-Type: text/plain; charset="UTF-8"
Archived-At: http://mailarchive.ietf.org/arch/msg/nfsv4/GYlV6-UheIw264uiu5OUJeDM3mU
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 01:26:22 -0000

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