[Libsysio-commit] HEAD: libsysio/src inode.c
Brought to you by:
lward
From: Lee W. <lw...@us...> - 2009-08-17 23:00:33
|
Update of /cvsroot/libsysio/libsysio/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv31563 Modified Files: inode.c Log Message: Two changes to _sysio_pb_gone 1) Use I_GONE instead of _sysio_i_gone directly. 2) BUGFIX! If the associated i-node is a zombie it was being released once by the PB_SET_ASSOC(..., NULL) and then again, later, when we are trying to force the i-node to go away. Added a special check to remove the latter, forced, gone if ref == 1 and zombie. Index: inode.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/inode.c,v retrieving revision 1.56 retrieving revision 1.57 diff -u -w -b -B -p -r1.56 -r1.57 --- inode.c 4 Aug 2009 05:46:24 -0000 1.56 +++ inode.c 17 Aug 2009 23:00:20 -0000 1.57 @@ -587,8 +587,18 @@ _sysio_pb_gone(struct pnode_base *pb) TAILQ_REMOVE(&pb_leaf_nodes, pb, pb_links); #endif ino = pb->pb_ino; - if (ino) + if (ino) { I_LOCK(ino); + if (ino->i_ref == 1 && ino->i_zombie) { + /* + * The PB_UNLOCK, below, will kill it before + * we have a chance to force the issue. Avoid + * the double gone by resetting the pointer + * to NULL. + */ + ino = NULL; + } + } PB_SET_ASSOC(pb, NULL); PB_UNLOCK(pb); mutex_destroy(&pb->pb_mutex); @@ -596,7 +606,7 @@ _sysio_pb_gone(struct pnode_base *pb) if (ino) { if (!(ino->i_ref || ino->i_immune || I_ISASSOC(ino))) - _sysio_i_gone(ino); + I_GONE(ino); else I_UNLOCK(ino); } |