Bug 161956 - [nullfs] [hang] filesystem lock with mount nullfs in random cases
Summary: [nullfs] [hang] filesystem lock with mount nullfs in random cases
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: Unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: Peter Holm
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-24 09:40 UTC by subbsd
Modified: 2011-10-31 15:08 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description subbsd 2011-10-24 09:40:03 UTC
filesystem (zfs or ufs) is freezing in random time when mount nullfs is work.

more information: http://docs.freebsd.org/cgi/getmsg.cgi?fetch=270240+0+archive/2011/freebsd-fs/20111023.freebsd-fs

How-To-Repeat: making it easy to reproduce when do 'svn cleanup' for mounted directory, see

http://docs.freebsd.org/cgi/getmsg.cgi?fetch=270240+0+archive/2011/freebsd-fs/20111023.freebsd-fs
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2011-10-25 14:14:04 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-fs

Over to maintainer(s).
Comment 2 Peter Holm freebsd_committer freebsd_triage 2011-10-27 09:37:11 UTC
State Changed
From-To: open->patched

Fixed in HEAD (r226681). 


Comment 3 Peter Holm freebsd_committer freebsd_triage 2011-10-27 09:37:11 UTC
Responsible Changed
From-To: freebsd-fs->pho
Comment 4 dfilter service freebsd_committer freebsd_triage 2011-10-31 09:18:11 UTC
Author: pho
Date: Mon Oct 31 09:18:01 2011
New Revision: 226963
URL: http://svn.freebsd.org/changeset/base/226963

Log:
  MFC r226681:
  Only unlock if the lock is exclusive.
  
  Approved by:	re (kib)
  PR:		kern/161956

Modified:
  stable/9/sys/fs/nullfs/null_vfsops.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)

Modified: stable/9/sys/fs/nullfs/null_vfsops.c
==============================================================================
--- stable/9/sys/fs/nullfs/null_vfsops.c	Mon Oct 31 09:06:33 2011	(r226962)
+++ stable/9/sys/fs/nullfs/null_vfsops.c	Mon Oct 31 09:18:01 2011	(r226963)
@@ -104,11 +104,10 @@ nullfs_mount(struct mount *mp)
 		return (EINVAL);
 
 	/*
-	 * Unlock lower node to avoid deadlock.
-	 * (XXX) VOP_ISLOCKED is needed?
+	 * Unlock lower node to avoid possible deadlock.
 	 */
 	if ((mp->mnt_vnodecovered->v_op == &null_vnodeops) &&
-		VOP_ISLOCKED(mp->mnt_vnodecovered)) {
+	    VOP_ISLOCKED(mp->mnt_vnodecovered) == LK_EXCLUSIVE) {
 		VOP_UNLOCK(mp->mnt_vnodecovered, 0);
 		isvnunlocked = 1;
 	}
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
Comment 5 dfilter service freebsd_committer freebsd_triage 2011-10-31 09:22:30 UTC
Author: pho
Date: Mon Oct 31 09:22:09 2011
New Revision: 226964
URL: http://svn.freebsd.org/changeset/base/226964

Log:
  MFC r226681:
  Only unlock if the lock is exclusive.
  
  PR:		kern/161956

Modified:
  stable/8/sys/fs/nullfs/null_vfsops.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/fs/nullfs/null_vfsops.c
==============================================================================
--- stable/8/sys/fs/nullfs/null_vfsops.c	Mon Oct 31 09:18:01 2011	(r226963)
+++ stable/8/sys/fs/nullfs/null_vfsops.c	Mon Oct 31 09:22:09 2011	(r226964)
@@ -104,11 +104,10 @@ nullfs_mount(struct mount *mp)
 		return (EINVAL);
 
 	/*
-	 * Unlock lower node to avoid deadlock.
-	 * (XXX) VOP_ISLOCKED is needed?
+	 * Unlock lower node to avoid possible deadlock.
 	 */
 	if ((mp->mnt_vnodecovered->v_op == &null_vnodeops) &&
-		VOP_ISLOCKED(mp->mnt_vnodecovered)) {
+	    VOP_ISLOCKED(mp->mnt_vnodecovered) == LK_EXCLUSIVE) {
 		VOP_UNLOCK(mp->mnt_vnodecovered, 0);
 		isvnunlocked = 1;
 	}
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
Comment 6 Peter Holm freebsd_committer freebsd_triage 2011-10-31 15:02:50 UTC
State Changed
From-To: patched->closed

Fix merged to stable/8 and stable/9.