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

Re: shutdown umount hangs



Ok try this patch...
Since we haven't been able to reproduce the problem here I
don't know if it will help or not, but give it a try.
It doesn't appear to make thing any worse :-)

--
Russell Cattelan
--
Digital Elves inc. -- Currently on loan to SGI
Linux XFS core developer.


--- /usr/tmp/TmpDir.18409-0/linux/fs/pagebuf/page_buf.c_1.72	Wed Apr  4 20:07:15 2001
+++ linux/fs/pagebuf/page_buf.c	Wed Apr  4 20:06:35 2001
@@ -2172,11 +2172,6 @@
 				continue;
 			  }
 
-				pb->pb_flags &= ~PBF_DELWRI;
-				pb->pb_flags |= PBF_WRITE;
-				if (flags & PBDF_WAIT)
-					pb->pb_flags &= ~PBF_ASYNC;
-
 			  	/* insert a place holder */
 				list_add(&pb_marker_ptr->pb_list, curr);
 
@@ -2184,40 +2179,33 @@
 						&pb_daemon->pb_delwrite_lock,
 						save);
 
-				if (pb->pb_flags & _PBF_LOCKABLE){
-				  if (flags & PBDF_PINCOUNT){
-					/* if we are doing this pin count thing and we can't get the lock just skip it for now */
-					}if (!pagebuf_cond_lock(pb)){
-					  __pagebuf_iorequest(pb);
-					} else {
-					  (*pincount)++;
-					  /* make it async again... don't want to wait on in below */
-					  pb->pb_flags |= PBF_ASYNC;
-					}
-				  }else {
-					pagebuf_lock(pb);
+				 /* if (pb->pb_flags & _PBF_LOCKABLE){ */
+				/* meta data pagebufs better be lockable pagebuf's */
+				  assert(pb->pb_flags & _PBF_LOCKABLE); 
+	
+				  if (!pagebuf_ispin(pb) && (0 == pagebuf_cond_lock(pb))){
+					pb->pb_flags &= ~PBF_DELWRI;
+					pb->pb_flags |= PBF_WRITE;
+					if (flags & PBDF_WAIT)
+					  pb->pb_flags &= ~PBF_ASYNC;
+
 					__pagebuf_iorequest(pb);
+				  } else {
+					if (flags & PBDF_PINCOUNT) 
+					  (*pincount)++;
 				  }
-
-				spin_lock_irqsave(
-						&pb_daemon->pb_delwrite_lock,
-						save);
+				spin_lock_irqsave(&pb_daemon->pb_delwrite_lock, save);
 				/*
 				 * ok got the lock back; pick up the place
 				 * holder and continue on
 				 */
 				curr = pb_marker_ptr->pb_list.next;
 				list_del(&pb_marker_ptr->pb_list);
-			} else {
-				/* not doing anything with current...
-				 * move on to the next one */
-				curr = curr->next;
-			}
-		} else {
-			/* not doing anything with current...
-			 * move on to the next one */
-			curr = curr->next;
-		}
+			} 
+		} 
+		/* not doing anything with current...
+		 * move on to the next one */
+		curr = curr->next;
 	}
 
 	spin_unlock_irqrestore(&pb_daemon->pb_delwrite_lock, save);
@@ -2270,14 +2258,13 @@
 		PB_TRACE(pb, PB_TRACE_REC(walkq3), pagebuf_ispin(pb));
 
 		if (pb->pb_target == target) {
-			int	sync = (pb->pb_flags & PBF_ASYNC) == 0;
 			list_add(&pb_marker_ptr->pb_list, curr);
 
 			spin_unlock_irqrestore(
 					&pb_daemon->pb_delwrite_lock,
 					flags);
 
-			if (sync) {
+			if (!(pb->pb_flags & PBF_ASYNC)) {
 				pagebuf_iowait(pb);
 				pb->pb_flags |= PBF_ASYNC;
 				pagebuf_delwri_dequeue(pb);