Subject: [nfsv4] NFSv4 : Expected behavior of the client upon receiving the NFS4ERR_BADHANDLE

From: Natesh Kedlaya <[email-masked]>
Date: Wed, 30 Sep 2009 09:31:28 -0700 (PDT)

Hello Experts,
  What is the expected behavior from an NFSv4 Client upon receiving the NFS4ERR_BADHANDLE error from the server?
  Should it do LOOKUP or OPEN to get the new File Handle?

Thanks,
Natesh

---

From: Trond Myklebust <[email-masked]>
Date: Wed, 30 Sep 2009 12:38:08 -0400

>   Should it do LOOKUP or OPEN to get the new File Handle?

Why would a correctly working client ever get NFS4ERR_BADHANDLE? If it
is using a filehandle that was given to it by and OPEN or LOOKUP from
the server, then the worst that can happen would be NFS4ERR_STALE or
NFS4ERR_FHEXPIRED.

   Trond

---

From: "Noveck, Dave" <[email-masked]>
Date: Wed, 30 Sep 2009 12:50:03 -0400

That's assuming you have a correctly working server, which of course
will always be the case :-)

I guess the other possiblity is that someone all of sudden boots an
entirely different OS and you are talking to a different server than you
were before.  In that case what were good handles will all of a sudden
become bad, but if you re-did a LOOKUP, odds are the directory handle
would also be bad.

With v4.1, you will notice that your session is gone so you will notice
the change when iot happens, but if you follow the normal reclaim
procedure in this case will get bad handles at that point.

I've never seen this kind of thing be an issue in real life, but there's
always a first time.

-----Original Message-----
From: Trond Myklebust [mailto:[email-masked]] 
Sent: Wednesday, September 30, 2009 12:38 PM
To: Natesh Kedlaya
Cc: [email-masked]
Subject: Re: [nfsv4] NFSv4 : Expected behavior of the client upon
receiving the NFS4ERR_BADHANDLE

On Wed, 2009-09-30 at 09:31 -0700, Natesh Kedlaya wrote:
> Hello Experts,
>   What is the expected behavior from an NFSv4 Client upon receiving
the NFS4ERR_BADHANDLE error from the server?

   Trond

_______________________________________________
nfsv4 mailing list
[email-masked]
https://www.ietf.org/mailman/listinfo/nfsv4

---

From: Trond Myklebust <[email-masked]>
Date: Wed, 30 Sep 2009 13:06:35 -0400

> I've never seen this kind of thing be an issue in real life, but there's

All bets are off if either the client or server are broken. Given a
corrupt filehandle you might get back a relevant error, but you might
equally well find yourself reading or writing to the wrong file.

You're safer just pinging userland with an errno=ESNAFU as soon as you
get something like NFS4ERR_BADHANDLE.

Cheers
  Trond