Re: [PATCH v2] NFS: Ensure that rmdir() waits for sillyrenames to complete

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx> 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@xxxxxxxxxx
www.netapp.com
From 2875e6f36755db12ed6a5b363f0d14a26fcb495b Mon Sep 17 00:00:00 2001
From: Trond Myklebust <Trond.Myklebust@xxxxxxxxxx>
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


[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux