From: Trond Myklebust <trond.myklebust@fys.uio.no>
To: Menyhart Zoltan <Zoltan.Menyhart@bull.net>
Cc: linux-nfs@vger.kernel.org
Subject: Re: Re :statfs() gives ESTALE error
Date: Wed, 08 Sep 2010 16:25:25 -0400 [thread overview]
Message-ID: <1283977525.2905.18.camel@heimdal.trondhjem.org> (raw)
In-Reply-To: <4C8790AF.5010300@bull.net>
On Wed, 2010-09-08 at 15:33 +0200, Menyhart Zoltan wrote:
> Hi,
>
> An NFS client executes a statfs("file", &buff) call.
> "file" exists / existed, the client has read / written it,
> but it has already closed it.
>
> user_path(pathname, &path) looks up "file" successfully in the
> directory-cache and restarts the aging timer of the directory-entry.
> Even if "file" has already been removed from the server, because the
> lookupcache=positive option I use, keeps the entries valid for a while.
>
> nfs_statfs() returns ESTALE if "file" has already been removed from the
> server.
>
> If the user application repeats the statfs("file", &buff) call, we
> are stuck: "file" remains young forever in the directory-cache.
>
> Signed-off-by: Zoltan Menyhart <Zoltan.Menyhart@bull.net>
---
Please include the above as part of the patch itself if you send it as
an attachment. Otherwise, I need to manually sew the two back together
before I can apply them through git.
> diff -Nru linux-2.6.36-rc3-orig/fs/nfs/super.c
> linux-2.6.36-rc3-new/fs/nfs/super.c
> --- linux-2.6.36-rc3-orig/fs/nfs/super.c 2010-08-29
> 17:36:04.000000000 +0200
> +++ linux-2.6.36-rc3-new/fs/nfs/super.c 2010-09-08 11:33:03.078684569
> +0200
> @@ -431,7 +431,15 @@
> goto out_err;
>
> error = server->nfs_client->rpc_ops->statfs(server, fh, &res);
> + if (unlikely(error == -ESTALE)) {
>
> + struct dentry *pd_dentry;
> +
> + if ((pd_dentry = dget_parent(dentry)) != NULL) {
Assignments inside an 'if ()' are frowned upon by the Linux style gods.
I'll fix this up.
> + nfs_zap_caches(pd_dentry->d_inode);
> + dput(pd_dentry);
> + }
> + }
> nfs_free_fattr(res.fattr);
> if (error < 0)
> goto out_err;
next prev parent reply other threads:[~2010-09-08 20:25 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-01 12:17 Relocate NFS root FS for maintenance Greg
2010-09-01 17:34 ` J. Bruce Fields
2010-09-01 21:52 ` Tom Haynes
2010-09-02 7:32 ` Greg
2010-09-02 16:06 ` J. Bruce Fields
2010-09-07 6:59 ` Greg
2010-09-02 6:56 ` statfs() gives ESTALE error Menyhart Zoltan
2010-09-07 18:32 ` Trond Myklebust
2010-09-08 13:33 ` Re :statfs() " Menyhart Zoltan
2010-09-08 20:25 ` Trond Myklebust [this message]
2010-09-09 8:12 ` Menyhart Zoltan
2010-09-20 12:49 ` Locking question around "...PagePrivate()" Menyhart Zoltan
2010-09-20 13:55 ` Trond Myklebust
2010-10-05 8:22 ` "xprt" reference count drops to 0 Menyhart Zoltan
2010-10-21 20:38 ` J. Bruce Fields
2010-10-22 15:00 ` Menyhart Zoltan
2010-10-22 21:20 ` J. Bruce Fields
2010-10-22 23:01 ` J. Bruce Fields
2010-10-22 23:21 ` J. Bruce Fields
2010-10-23 3:32 ` J. Bruce Fields
2010-10-25 1:09 ` J. Bruce Fields
2010-10-25 1:21 ` [PATCH 1/4] svcrpc: never clear XPT_BUSY on dead xprt J. Bruce Fields
2010-10-25 1:43 ` Neil Brown
2010-10-25 20:21 ` J. Bruce Fields
2010-10-25 22:58 ` Neil Brown
2010-10-25 23:03 ` J. Bruce Fields
2010-10-25 23:54 ` Neil Brown
2010-10-26 0:11 ` J. Bruce Fields
2010-10-26 0:28 ` J. Bruce Fields
2010-10-26 0:30 ` J. Bruce Fields
2010-10-26 1:28 ` Neil Brown
2010-10-26 12:59 ` J. Bruce Fields
2010-10-26 16:05 ` J. Bruce Fields
2010-11-12 19:00 ` J. Bruce Fields
2010-10-25 1:21 ` [PATCH 2/4] svcrpc: assume svc_delete_xprt() called only once J. Bruce Fields
2010-10-25 1:21 ` [PATCH 3/4] svcrpc: no need for XPT_DEAD check in svc_xprt_enqueue J. Bruce Fields
2010-10-25 1:21 ` [PATCH 4/4] svcrpc: svc_tcp_sendto XTP_DEAD check is redundant J. Bruce Fields
2010-10-25 2:10 ` Neil Brown
2010-10-25 15:03 ` J. Bruce Fields
2010-10-25 17:46 ` J. Bruce Fields
2010-10-25 23:08 ` Neil Brown
2010-10-26 1:33 ` J. Bruce Fields
2010-10-25 23:23 ` Neil Brown
2010-10-26 1:25 ` J. Bruce Fields
2010-10-25 11:56 ` "xprt" reference count drops to 0 Menyhart Zoltan
2010-10-25 14:36 ` J. Bruce Fields
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=1283977525.2905.18.camel@heimdal.trondhjem.org \
--to=trond.myklebust@fys.uio.no \
--cc=Zoltan.Menyhart@bull.net \
--cc=linux-nfs@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).