From: "Myklebust, Trond" <Trond.Myklebust@netapp.com>
To: Olga Kornievskaia <aglo@citi.umich.edu>
Cc: Miklos Szeredi <miklos@szeredi.hu>,
"linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>,
"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] NFSv4: Return the delegation if the server returns NFS4ERR_OPENMODE
Date: Thu, 8 Mar 2012 18:15:26 +0000 [thread overview]
Message-ID: <1331230525.2472.39.camel@lade.trondhjem.org> (raw)
In-Reply-To: <CAN-5tyG-w+ie3sxTwNA6e9x=CojxyDaJScJuCbS+9VE=yTmJNA@mail.gmail.com>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 1732 bytes --]
On Thu, 2012-03-08 at 12:52 -0500, Olga Kornievskaia wrote:
> wouldn't it be better for you to proactively return a read delegation
> then unnecessarily erroring?
If nobody else holds a delegation, then the NFS client is actually
allowed to keep its read delegation while writing to the file. It does
admittedly need to request an OPEN stateid for write in that case...
(See section 10.4 of RFC3530bis draft 16)
That said, in either case we do need to deal with the fact that a new
delegation may be granted after we return the old one. There is no
locking around the setattr call to prevent this.
> i also don't understand how this error occurs. doing a setattr in this
> case you must have used a non-special stateid. the server would only
> return an err_openmode if you sent the setattr with a read delegation
> stateid. i guess my question is what stateid would you use that from
> client's perspective represent a write-type state id but yet a server
> would flag as having wrong access type?
The read delegation stateid is being sent as per the prescription in
section 9.1.3.6 of RFC3530bis.
> also i'm curious why would a server, instead of returning
> err_openmode, would not first recall your read delegation?
It could, but why do so when it can just return an error value? The
presence of the delegation stateid in the SETATTR request allows it to
communicate directly to the client what the problem is without the need
for any callbacks.
Cheers
Trond
--
Trond Myklebust
Linux NFS client maintainer
NetApp
Trond.Myklebust@netapp.com
www.netapp.com
ÿôèº{.nÇ+·®+%Ëÿ±éݶ\x17¥wÿº{.nÇ+·¥{±þG«éÿ{ayº\x1dÊÚë,j\a¢f£¢·hïêÿêçz_è®\x03(éÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?¨èÚ&£ø§~á¶iOæ¬z·vØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?I¥
next prev parent reply other threads:[~2012-03-08 18:15 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-06 10:10 NFSv4: truncate returns I/O error Miklos Szeredi
2012-03-06 14:16 ` Myklebust, Trond
2012-03-07 22:40 ` [PATCH 0/2] " Trond Myklebust
2012-03-07 22:40 ` [PATCH 1/2] NFS: Properly handle the case where the delegation is revoked Trond Myklebust
2012-03-07 22:40 ` [PATCH 2/2] NFSv4: Return the delegation if the server returns NFS4ERR_OPENMODE Trond Myklebust
2012-03-08 17:52 ` Olga Kornievskaia
2012-03-08 18:15 ` Myklebust, Trond [this message]
2012-03-08 20:23 ` Olga Kornievskaia
2012-03-08 20:42 ` J. Bruce Fields
2012-03-08 20:50 ` Myklebust, Trond
2012-03-08 20:57 ` J. Bruce Fields
2012-03-08 21:02 ` Myklebust, Trond
2012-03-08 21:09 ` J. Bruce Fields
2012-03-08 21:12 ` Boaz Harrosh
2012-03-08 21:27 ` Olga Kornievskaia
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=1331230525.2472.39.camel@lade.trondhjem.org \
--to=trond.myklebust@netapp.com \
--cc=aglo@citi.umich.edu \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=miklos@szeredi.hu \
/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
all inboxes | Powered by JetHome®