changeset 10278:61e767547602

6594239 Interrupting fssnap when it is being trussed will wedge the system
author batschul <Frank.Batschulat@Sun.COM>
date Fri, 07 Aug 2009 09:58:35 -0600
parents 8c0d8d983f7d
children 73b1c2ddbfad
files usr/src/uts/common/fs/ufs/ufs_lockfs.c
diffstat 1 files changed, 13 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/uts/common/fs/ufs/ufs_lockfs.c	Fri Aug 07 06:47:37 2009 -0600
+++ b/usr/src/uts/common/fs/ufs/ufs_lockfs.c	Fri Aug 07 09:58:35 2009 -0600
@@ -239,11 +239,21 @@
 	int error = 0;
 	ulockfs_info_t *head;
 	ulockfs_info_t *info;
+	klwp_t *lwp = ttolwp(curthread);
 
 	head = (ulockfs_info_t *)tsd_get(ufs_lockfs_key);
 	SEARCH_ULOCKFSP(head, ulp, info);
 
 	/*
+	 * We have to keep /proc away from stopping us after we applied
+	 * the softlock but before we got a chance to clear it again.
+	 * prstop() may pagefault and become stuck on the softlock still
+	 * pending.
+	 */
+	if (lwp != NULL)
+		lwp->lwp_nostop++;
+
+	/*
 	 * Set a softlock to suspend future ufs_vnops so that
 	 * this lockfs request will not be starved
 	 */
@@ -279,6 +289,9 @@
 	 */
 	ULOCKFS_CLR_SLOCK(ulp);
 
+	if (lwp != NULL)
+		lwp->lwp_nostop--;
+
 	return (error);
 }