linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Myklebust, Trond" <Trond.Myklebust@netapp.com>
To: William Dauchy <wdauchy@gmail.com>
Cc: Linux NFS mailing list <linux-nfs@vger.kernel.org>,
	"Adamson, Andy" <William.Adamson@netapp.com>,
	William Dauchy <william@gandi.net>
Subject: Re: [PATCH v2] NFS: Ensure that rmdir() waits for sillyrenames to complete
Date: Tue, 3 Sep 2013 18:50:34 +0000	[thread overview]
Message-ID: <1378234234.6410.36.camel@leira.trondhjem.org> (raw)
In-Reply-To: <CAJ75kXbRgsYVRNobCmjeL-t+AJproq8jAxXkbkk9DxGnE9eYhQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1016 bytes --]

On Tue, 2013-09-03 at 11:33 +0200, William Dauchy wrote:
> On Mon, Sep 2, 2013 at 8:17 PM, Trond Myklebust
> <Trond.Myklebust@netapp.com> wrote:
> > If an NFS client does
> >
> >         mkdir("dir");
> >         fd = open("dir/file");
> >         unlink("dir/file");
> >         close(fd);
> >         rmdir("dir");
> >
> > then the asynchronous nature of the sillyrename operation means that
> > we can end up getting EBUSY for the rmdir() in the above test. Fix
> > that by ensuring that we wait for any in-progress sillyrenames
> > before sending the rmdir() to the server.
> 
> I tested the patch on top of a 3.10.x
> When doing heavy operations like rm -rf dir/ with lots of data, the
> process gets stuck for ever.
> removing the patch fixes the issue.
> 

Hi William,

Thanks again for testing! Does the following fixup on top of the 'v2'
patch also help?

Cheers
  Trond

-- 
Trond Myklebust
Linux NFS client maintainer

NetApp
Trond.Myklebust@netapp.com
www.netapp.com

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-fixup-NFS-Ensure-that-rmdir-waits-for-sillyrenames-t.patch --]
[-- Type: text/x-patch; name="0001-fixup-NFS-Ensure-that-rmdir-waits-for-sillyrenames-t.patch", Size: 803 bytes --]

From 2875e6f36755db12ed6a5b363f0d14a26fcb495b Mon Sep 17 00:00:00 2001
From: Trond Myklebust <Trond.Myklebust@netapp.com>
Date: Tue, 3 Sep 2013 14:48:21 -0400
Subject: [PATCH] fixup! NFS: Ensure that rmdir() waits for sillyrenames to
 complete

---
 fs/nfs/unlink.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/nfs/unlink.c b/fs/nfs/unlink.c
index 0c6dfe0..bb939ed 100644
--- a/fs/nfs/unlink.c
+++ b/fs/nfs/unlink.c
@@ -211,7 +211,7 @@ void nfs_wait_on_sillyrename(struct dentry *dentry)
 {
 	struct nfs_inode *nfsi = NFS_I(dentry->d_inode);
 
-	wait_event(nfsi->waitqueue, atomic_read(&nfsi->silly_count) == 1);
+	wait_event(nfsi->waitqueue, atomic_read(&nfsi->silly_count) <= 1);
 }
 
 void nfs_block_sillyrename(struct dentry *dentry)
-- 
1.8.3.1


  reply	other threads:[~2013-09-03 18:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-02 18:17 [PATCH v2] NFS: Ensure that rmdir() waits for sillyrenames to complete Trond Myklebust
2013-09-03  9:33 ` William Dauchy
2013-09-03 18:50   ` Myklebust, Trond [this message]
2013-09-03 20:44     ` William Dauchy
2013-09-03 20:47       ` Myklebust, Trond
2013-09-04  9:19         ` William Dauchy

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=1378234234.6410.36.camel@leira.trondhjem.org \
    --to=trond.myklebust@netapp.com \
    --cc=William.Adamson@netapp.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=wdauchy@gmail.com \
    --cc=william@gandi.net \
    /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).