From: Trond Myklebust <trond.myklebust@fys.uio.no>
To: Florin Iucha <florin@iucha.net>
Cc: Bret Towe <magnade@gmail.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Michal Piotrowski <michal.k.k.piotrowski@gmail.com>
Subject: Re: NFS woes again Was: [linux-usb-devel] USB-related oops in sysfs with linux v2.6.23-rc3-50-g28e8351
Date: Mon, 27 Aug 2007 09:17:31 -0400 [thread overview]
Message-ID: <1188220651.6701.32.camel@heimdal.trondhjem.org> (raw)
In-Reply-To: <20070823173637.GS10422@iucha.net>
[-- Attachment #1: Type: text/plain, Size: 625 bytes --]
On Thu, 2007-08-23 at 12:36 -0500, Florin Iucha wrote:
> On Thu, Aug 23, 2007 at 10:14:38AM -0700, Bret Towe wrote:
> > this sounds alot like the post i did yesterday titled 'nfs4 hang regression'
> > i tracked it down to commit 3d39c691ff486142dd9aaeac12f553f4476b7a6
>
> Yes, it certainly does -- all the symptoms match!
>
> I'm not [alone in] seeing dead keyboards!
>
> Now, if only somebody could clarify to me the connection between
> the bad NFS4 shooting the keyboard but not the mouse, that would
> be wonderful.
>
> florin
Could you and Bret please check if the attached patch fixes the hang?
Cheers
Trond
[-- Attachment #2: linux-2.6.23-001-fix_cancel_work_hang.dif --]
[-- Type: message/rfc822, Size: 2327 bytes --]
From: Trond Myklebust <Trond.Myklebust@netapp.com>
Subject: No Subject
Date: Mon, 27 Aug 2007 09:14:56 -0400
Message-ID: <1188220651.6701.33.camel@heimdal.trondhjem.org>
We need to ensure that nobody adds anything to nfs_automount_list while we
are killing off the work queue entry, or else nfs_expire_automounts will
simply rearm it, and we hang.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
---
fs/nfs/namespace.c | 14 +++++++++++++-
1 files changed, 13 insertions(+), 1 deletions(-)
diff --git a/fs/nfs/namespace.c b/fs/nfs/namespace.c
index aea76d0..bcd0777 100644
--- a/fs/nfs/namespace.c
+++ b/fs/nfs/namespace.c
@@ -22,6 +22,11 @@ static void nfs_expire_automounts(struct work_struct *work);
LIST_HEAD(nfs_automount_list);
static DECLARE_DELAYED_WORK(nfs_automount_task, nfs_expire_automounts);
+/*
+ * The following mutex prevents nfs_follow_mountpoint from adding new
+ * entries to nfs_automount_list
+ */
+static DEFINE_MUTEX(nfs_automount_mutex);
int nfs_mountpoint_expiry_timeout = 500 * HZ;
static struct vfsmount *nfs_do_submount(const struct vfsmount *mnt_parent,
@@ -128,18 +133,21 @@ static void * nfs_follow_mountpoint(struct dentry *dentry, struct nameidata *nd)
goto out_err;
mntget(mnt);
+ mutex_lock(&nfs_automount_mutex);
err = do_add_mount(mnt, nd, nd->mnt->mnt_flags|MNT_SHRINKABLE, &nfs_automount_list);
if (err < 0) {
+ mutex_unlock(&nfs_automount_mutex);
mntput(mnt);
if (err == -EBUSY)
goto out_follow;
goto out_err;
}
+ schedule_delayed_work(&nfs_automount_task, nfs_mountpoint_expiry_timeout);
+ mutex_unlock(&nfs_automount_mutex);
mntput(nd->mnt);
dput(nd->dentry);
nd->mnt = mnt;
nd->dentry = dget(mnt->mnt_root);
- schedule_delayed_work(&nfs_automount_task, nfs_mountpoint_expiry_timeout);
out:
dprintk("%s: done, returned %d\n", __FUNCTION__, err);
@@ -175,8 +183,12 @@ static void nfs_expire_automounts(struct work_struct *work)
void nfs_release_automount_timer(void)
{
+ if (!list_empty(&nfs_automount_list))
+ return;
+ mutex_lock(&nfs_automount_mutex);
if (list_empty(&nfs_automount_list))
cancel_delayed_work_sync(&nfs_automount_task);
+ mutex_unlock(&nfs_automount_mutex);
}
/*
next prev parent reply other threads:[~2007-08-27 13:17 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-15 13:31 Florin Iucha
2007-08-15 14:38 ` [linux-usb-devel] " Alan Stern
2007-08-15 14:50 ` Florin Iucha
2007-08-15 15:24 ` Alan Stern
2007-08-15 14:54 ` Tejun Heo
2007-08-15 15:21 ` Cornelia Huck
2007-08-15 15:30 ` Tejun Heo
2007-08-15 15:33 ` Alan Stern
2007-08-15 14:49 ` Jiri Kosina
2007-08-15 14:53 ` Florin Iucha
2007-08-15 14:58 ` Jiri Kosina
2007-08-21 11:51 ` Florin Iucha
2007-08-21 12:04 ` Jiri Kosina
2007-08-21 12:28 ` Florin Iucha
2007-08-21 14:51 ` Alan Stern
2007-08-21 12:06 ` Oliver Neukum
2007-08-21 12:09 ` Jiri Kosina
2007-08-21 12:19 ` Oliver Neukum
2007-08-21 12:57 ` Florin Iucha
2007-08-21 13:05 ` Jiri Kosina
2007-08-21 13:17 ` Florin Iucha
2007-08-21 13:27 ` Florin Iucha
2007-08-21 13:42 ` Jiri Kosina
2007-08-22 13:22 ` Florin Iucha
2007-08-23 12:52 ` NFS woes again Was: " Florin Iucha
2007-08-23 17:14 ` Bret Towe
2007-08-23 17:36 ` Florin Iucha
2007-08-27 13:17 ` Trond Myklebust [this message]
2007-08-28 1:19 ` Bret Towe
2007-08-28 1:35 ` NFS woes again Florin Iucha
2007-08-28 13:28 ` Trond Myklebust
2007-08-29 3:27 ` Florin Iucha
2007-08-29 5:52 ` Bret Towe
2007-08-30 22:18 ` Bret Towe
2007-08-30 23:14 ` Florin Iucha
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=1188220651.6701.32.camel@heimdal.trondhjem.org \
--to=trond.myklebust@fys.uio.no \
--cc=florin@iucha.net \
--cc=linux-kernel@vger.kernel.org \
--cc=magnade@gmail.com \
--cc=michal.k.k.piotrowski@gmail.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 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®