[Libsysio-commit] HEAD: libsysio/src file.c
Brought to you by:
lward
From: Lee W. <lw...@us...> - 2004-04-28 12:23:27
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31477/src Modified Files: file.c Log Message: From Sue Kelly; Mike says it shows an unlink, followed by 2 closes, all on the same fd.The second close is getting the assert failure, I guess. We weren't tracking the number of soft references on the inode with file open/close. Hence, it was always 1. When unlink was called, it tries to whack the inode. We've implemented zombie inode code but since there was only one reference, the inode would immediately die. Then, the file close code would try to close it again. However, the inode had already been free'd. Some paranoia in the lower code cleared fields before releasing the memory to protect against just such an event. Voila, instant assertion. Good for us. The fix, of course, is to address the root cause. Inode open/close pairs are now tracked in the file code by referencing and dereferencing the affected inode. Unlink is unchanged. However, now the zombie handling code gets a chance to do it's thing correctly. Index: file.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/file.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -w -b -B -p -r1.10 -r1.11 --- file.c 28 Feb 2004 14:10:58 -0000 1.10 +++ file.c 28 Apr 2004 12:23:19 -0000 1.11 @@ -75,6 +75,7 @@ _sysio_fnew(struct inode *ino, int flags return NULL; _SYSIO_FINIT(fil, ino, flags); + I_REF(ino); return fil; } |