[Ocfs2-commits] mfasheh commits r1332 - trunk/src

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Fri Aug 6 17:17:51 CDT 2004


Author: mfasheh
Date: 2004-08-06 16:17:49 -0500 (Fri, 06 Aug 2004)
New Revision: 1332

Modified:
   trunk/src/dlm.c
   trunk/src/ocfs.h
Log:
* move the ocfs_sleep in acquire_lock *below* the signal check as
  otherwise we were always sleeping. Also, change the two
  ocfs_sleep(500) to ocfs_sleep(50). The best thing to do is get rid of
  these altogether but that can happen later.

* ocfs_task_interruptible() was horribly broken and checked for *all*
  signals. Fix it to check for SIGKILL and SIGINT only.



Modified: trunk/src/dlm.c
===================================================================
--- trunk/src/dlm.c	2004-08-04 20:23:58 UTC (rev 1331)
+++ trunk/src/dlm.c	2004-08-06 21:17:49 UTC (rev 1332)
@@ -292,7 +292,7 @@
 				if (status < 0) {
 					ocfs_release_lockres(lockres); // ocfs_file_open ocfs_symlink
 					if (status == -EAGAIN) {
-						if (ocfs_task_interruptible (osb)) {
+						if (ocfs_task_interruptible ()) {
 							LOG_TRACE_ARGS("interrupted... lockid=%llu\n",
 								offset);
 							status = -EINTR;
@@ -709,7 +709,7 @@
 				ocfs_release_lockres (lockres); // ocfs_file_open ocfs_symlink
 				if (status == -EAGAIN) {
 					ocfs_sleep (500);
-					if (ocfs_task_interruptible (osb)) {
+					if (ocfs_task_interruptible ()) {
 						LOG_TRACE_ARGS("interrupted... lockid=%llu\n",
 							OCFS_I(inode)->ip_blkno << inode->i_sb->s_blocksize_bits);
 						status = -EINTR;
@@ -756,8 +756,8 @@
 				LOG_ERROR_STATUS (status);
 			ocfs_release_lockres (lockres); // ocfs_file_open ocfs_symlink
 			if (status == -EAGAIN) {
-				ocfs_sleep (500);
-				if (ocfs_task_interruptible (osb)) {
+				ocfs_sleep (50);
+				if (ocfs_task_interruptible ()) {
 					LOG_TRACE_ARGS("interrupted... lockid=%llu\n",
 					OCFS_I(inode)->ip_blkno << inode->i_sb->s_blocksize_bits);
 					status = -EINTR;
@@ -998,13 +998,13 @@
 			if (status == -ETIMEDOUT)
 				LOG_ERROR_ARGS("Timed out acquiring lock for inode %llu, (lockid = %llu) retrying...\n", OCFS_I(inode)->ip_blkno, lock_id);
 
-			ocfs_sleep (500);
-			if (ocfs_task_interruptible (osb)) {
+			if (ocfs_task_interruptible ()) {
 				LOG_TRACE_ARGS("interrupted... lockid=%llu\n",
 					OCFS_I(inode)->ip_blkno << inode->i_sb->s_blocksize_bits);
 				status = -EINTR;
 				goto finally;
 			}
+			ocfs_sleep (50);
 			updated = 0;
 			goto again;
 		}
@@ -1112,7 +1112,7 @@
 				ocfs_acquire_lockres(lockres, 0);
 				continue;
 			}
-			else if (status == -EINTR && ocfs_task_interruptible (osb)) {
+			else if (status == -EINTR && ocfs_task_interruptible ()) {
 				LOG_ERROR_STR("interrupted!\n");
 				goto finally;
 			} else 
@@ -1370,7 +1370,7 @@
 	}
 
 	if (status == -EAGAIN) {
-		if (ocfs_task_interruptible (osb)) {
+		if (ocfs_task_interruptible ()) {
 			LOG_TRACE_ARGS("interrupted.... lockid=%llu\n",
 				OCFS_I(inode)->ip_blkno << inode->i_sb->s_blocksize_bits);
 			status = -EINTR;

Modified: trunk/src/ocfs.h
===================================================================
--- trunk/src/ocfs.h	2004-08-04 20:23:58 UTC (rev 1331)
+++ trunk/src/ocfs.h	2004-08-06 21:17:49 UTC (rev 1332)
@@ -276,7 +276,12 @@
 		}			\
 	} while (0)
 
-#define ocfs_task_interruptible(_o)	((_o)->dlm_task != current && signal_pending(current))
+static inline int ocfs_task_interruptible(void)
+{
+	return (signal_pending(current) && 
+	    (sigismember(&(current->pending.signal), SIGKILL) ||
+	     sigismember(&(current->pending.signal), SIGINT)));
+}
 
 /*
 ** Macros



More information about the Ocfs2-commits mailing list