Skip to contentSkip to conversation

fix for continuous receiving FLAG_VOTE_UPDATE_RETRY

PATCH New Ling 2 participants 2 messages Jul 5, 2004 OCFS2

lore
Share & tools
lore

Ling

#0 lore raw

PATCH 1/1 fix for continuous receiving FLAG_VOTE_UPDATE_RETRY

It seems the inode lock system map file is not released after = acquired.That causes when another node want to acquire it, this node found it is already holded.

-------------------------------------------------------------------------=
-------
Index: alloc.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

alloc.c +0 -0
@@ -482,6 +482,21 @@
 	}

=20
for (i =3D 0; i < osb->max_nodes; i++) {
+ if (inode_alloc_free[i] !=3D NULL) {
+ down_write(&OCFS_I(inode_alloc_inode[i])->ip_io_sem);
+ status =3D ocfs_release_lock (osb,

+						    OCFS_LKM_EXMODE,
+						    FLAG_FILE_CREATE,
+						    NULL, inode_alloc_inode[i]);

+ up_write(&OCFS_I(inode_alloc_inode[i])->ip_io_sem);
+ if (status < 0) {
+ LOG_ERROR_STATUS (status);
+ goto finally;
+ }
+ }
+ }
+=09
+ for (i =3D 0; i < osb->max_nodes; i++) {
if (ext_alloc_free[i] !=3D NULL) {
down_write(&OCFS_I(ext_alloc_inode[i])->ip_io_sem); status =3D ocfs_release_lock (osb,

Quoted 22 lines

-----Original Message-----
From: [email protected]=20 [mailto:[email protected]] On Behalf Of Ling, Xiaofeng
Sent: 2004=C4=EA7=D4=C25=C8=D5 13:32
To: Ocfs2-Devel
Subject: RE: [Ocfs2-devel] [Patch] fix block when receive=20 reply with retry--unsigned statuscause block=20

I've found the FLAG_VOTE_UPDATE_RETRY is sent at nm.c line=20 1515(svn 1238),=20
because lockres->lock_holders>0.

The reproduce step:
Node A:
mkdir /ocfs/aa
Node B:
rmdir /ocfs/aa
Node A:
mkdir /ocfs/bb
...now Node A receive FLAG_VOTE_UPDATE_RETRY and always resend=20 the CHANGE_MASTER message.

Quoted 21 lines

=20

Quoted 3 lines

-----Original Message-----
From: [email protected]=20 [mailto:[email protected]] On Behalf Of=20

Ling, Xiaofeng

Quoted 15 lines

Sent: 2004=C4=EA7=D4=C22=C8=D5 14:20
To: Mark Fasheh
Cc: Ocfs2-Devel
Subject: [Ocfs2-devel] [Patch] fix block when receive reply=20 with retry-- unsigned statuscause block=20

the vote_stauts of ocfs_vote_obj is defined as __u32, this causes "obj->vote_status < 0" always fail in ocfs_comm_process_vote_reply. When receive reply message with FLAG_VOTE_UPDATE_RETRY, the process is block.
I have not found what causes FLAG_VOTE_UPDATE_RETRY is sent back.

-------------------------------------------------------------------
Index: ocfs.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

Quoted 22 lines
Quoted 11 lines
ocfs.h (working copy) renamed from ocfs.h (revision 1232) +1 -1
@@ -753,7 +753,7 @@
       spinlock_t lock;
       __u32 vote_state;
       __u32 req_lock_type;
-       __u32 vote_status;
+       int vote_status;
       ocfs_node_map req_vote_map;
       ocfs_node_map got_vote_map;
       ocfs_node_map tmp_openmap;
Quoted 6 lines

_______________________________________________
Ocfs2-devel mailing list
[email protected]
http://oss.oracle.com/mailman/listinfo/ocfs2-devel

_______________________________________________
Ocfs2-devel mailing list
[email protected]
http://oss.oracle.com/mailman/listinfo/ocfs2-devel

#1 lore raw

PATCH 1/1 fix for continuous receiving FLAG_VOTE_UPDATE_RETRY

Quoted 2 lines · Xiaofeng

It seems the inode lock system map file is not released after acquired.That causes when another node want to acquire it, this node found it is already holded.

Ahh, good catch! I saw that bug but hadn't had a chance to track it down. It also looks like, down below that code we're not freeing the inode_alloc_inode and the inode_alloc_free array.

Quoted 17 lines

--------------------------------------------------------------------------------
Index: alloc.c
===================================================================

alloc.c +8 -0
@@ -482,6 +482,21 @@
 	}
 
 	for (i = 0; i < osb->max_nodes; i++) {
+		if (inode_alloc_free[i] != NULL) {
+			down_write(&OCFS_I(inode_alloc_inode[i])->ip_io_sem);
+			status = ocfs_release_lock (osb,
+						    OCFS_LKM_EXMODE,
+						    FLAG_FILE_CREATE,
+						    NULL, inode_alloc_inode[i]);
+			up_write(&OCFS_I(inode_alloc_inode[i])->ip_io_sem);
+			if (status < 0) {

alloc.c line 502

Quoted 10 lines
alloc.c +7 -0
+				LOG_ERROR_STATUS (status);
+				goto finally;
+			}
+		}
+	}
+	
+	for (i = 0; i < osb->max_nodes; i++) {
 		if (ext_alloc_free[i] != NULL) {
 			down_write(&OCFS_I(ext_alloc_inode[i])->ip_io_sem);
 			status = ocfs_release_lock (osb,

Hmm, since we loop on the same conditions (i < osb->max_nodes), could you resend with both 'if' blocks within the same 'for' loop? Also, if you feel like fixing the bug noted above in the same patch, that'd be just fine with me :)

	--Mark

--
Mark Fasheh
Software Developer, Oracle Corp
[email protected]