[leafnode-list] Restoring Hard Links - Texpire

Matthias Andree ma at dt.e-technik.uni-dortmund.de
Tue Jun 29 19:08:49 CEST 2004


"Jeff Grossman" <jeff at stikman.com> writes:

> Let me go look at the logs today, because Texpire ran this morning.  Yup,
> once again, I have tons of restored hard links in my log this morning.
>
> Let me know if there is anything I can do.  Otherwise, I might just kill the
> spool and start over.  I would prefer to not do that, but if nothing else
> works.

OK, so there is some bug. Running texpire twice, the 2nd run shouldn't
need to make any changes except when a posting has just expired, which
would be few.

The current leafnode-2 texpire may fail to restore links for
crosspostings, and the groups might then compete for the cross-posted
articles.

Does this patch improve the situation? It's a forward-port of a
leafnode-1 texpire bugfix. Apply the patch, then recompile and
reinstall, and run texpire twice. The 2nd run shouldn't print any 
"restored hard link" messages.

Index: texpire.c
===================================================================
RCS file: /var/CVS/leafnode-2/texpire.c,v
retrieving revision 1.48
diff -u -r1.48 texpire.c
--- texpire.c	22 Jun 2004 12:43:48 -0000	1.48
+++ texpire.c	29 Jun 2004 17:00:31 -0000
@@ -479,9 +479,11 @@
 			/* atomically regenerate link to make sure the
 			 * article is not lost -- unlink+link is not
 			 * safe */
-			(void)unlink(".to.relink");
-			if (link(name, ".to.relink")
-			    || rename(".to.relink", m)) {
+			if (link(name, m)
+				&& (errno != EEXIST
+				    || rename(m, name)
+				    || link(name, m)))
+			{
 			    ln_log(LNLOG_SERR,
 				   LNLOG_CARTICLE,
 				   "%s: cannot restore hard link "


-- 
Matthias Andree

Encrypted mail welcome: my GnuPG key ID is 0x052E7D95



More information about the leafnode-list mailing list