From: Anna Schumaker <Anna.Schumaker@netapp.com>
To: Trond Myklebust <trond.myklebust@primarydata.com>,
Olga Kornievskaia <kolga@netapp.com>
Cc: Linux NFS Mailing List <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH 1/1] Recover from stateid-type error on SETATTR
Date: Fri, 12 Jun 2015 14:56:34 -0400 [thread overview]
Message-ID: <557B2B62.8040700@Netapp.com> (raw)
In-Reply-To: <CAHQdGtTSzfHL8WaMXRN+vVmUuTQ6a8w71zFpkutTkaVgAG_TYQ@mail.gmail.com>
Hey Trond,
On 06/12/2015 02:37 PM, Trond Myklebust wrote:
> Hi Olga,
>
> On Fri, Jun 12, 2015 at 2:30 PM, Olga Kornievskaia <kolga@netapp.com> wrote:
>> Client can receives stateid-type error (eg., BAD_STATEID) on SETATTR when
>> delegation stateid was used. When no open state exists, in case of application
>> calling truncate() on the file, client has no state to recover and fails with
>> EIO.
>>
>> Instead, upon such error, return the bad delegation and then resend the
>> SETATTR with a zero stateid.
>>
>> Signed-off: Olga Kornievskaia <kolga@netapp.com>
>> ---
>> fs/nfs/delegation.h | 6 ++++++
>> fs/nfs/nfs4proc.c | 7 ++++++-
>> 2 files changed, 12 insertions(+), 1 deletion(-)
>>
>> diff --git a/fs/nfs/delegation.h b/fs/nfs/delegation.h
>> index e3c20a3..e37165f 100644
>> --- a/fs/nfs/delegation.h
>> +++ b/fs/nfs/delegation.h
>> @@ -62,6 +62,12 @@ void nfs_mark_delegation_referenced(struct nfs_delegation *delegation);
>> int nfs4_have_delegation(struct inode *inode, fmode_t flags);
>> int nfs4_check_delegation(struct inode *inode, fmode_t flags);
>>
>> +static inline int nfs4_have_any_delegation(struct inode *inode)
>> +{
>> + struct nfs_inode *nfsi = NFS_I(inode);
>> + return rcu_access_pointer(nfsi->delegation) ? 1 : 0;
>> +}
>
> What would this do that isn't already covered by
> nfs4_have_delegation(inode, FMODE_READ)?
It looks like _nfs4_do_settattr() can select between FMODE_READ and FMODE_WRITE, so wouldn't we otherwise need to call nfs4_have_delegation() twice? Or am I missing something?
Anna
>
> Cheers
> Trond
>
next prev parent reply other threads:[~2015-06-12 18:56 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-12 18:30 [PATCH 1/1] Recover from stateid-type error on SETATTR Olga Kornievskaia
2015-06-12 18:37 ` Trond Myklebust
2015-06-12 18:48 ` Kornievskaia, Olga
2015-06-12 20:02 ` Trond Myklebust
2015-06-12 18:56 ` Anna Schumaker [this message]
-- strict thread matches above, loose matches on Subject: below --
2015-06-12 20:53 Olga Kornievskaia
2015-06-12 21:21 ` Trond Myklebust
2015-06-12 21:37 ` Kornievskaia, Olga
2015-06-12 21:42 ` Trond Myklebust
2015-06-15 16:03 ` Kornievskaia, Olga
2015-04-21 22:36 Olga Kornievskaia
2015-04-27 17:48 ` Olga Kornievskaia
2015-05-04 16:24 ` 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=557B2B62.8040700@Netapp.com \
--to=anna.schumaker@netapp.com \
--cc=kolga@netapp.com \
--cc=linux-nfs@vger.kernel.org \
--cc=trond.myklebust@primarydata.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.