line too long?

Alex Kiernan alexk at demon.net
Tue Apr 3 09:43:14 UTC 2001


Katsuhiro Kondou <kondou at nec.co.jp> writes:

> In article <Pine.BSF.4.33.0104030004120.91376-100000 at mobile.hub.org>,
> 	The Hermit Hacker <scrappy at hub.org> wrote;
> 
> } few sm samples:
> } 
> } =============
> } news.hub.org> sm @03046374726C31000000000310260000003D@
> } CBuf3ctrl1/news/spool/articles/control00000000064a000000000000017e9400000000003ac6f647000000000000003e
> 
> Hm, the problem you're seeing is just same as what Joe saw.
> Flushed cycbuff header is incorrectly written to where article
> should start.  cnfs.c was modified to be more smart by Alex on
> Feb 12, and the patch looks ok to me.  You can revert to 1.82
> which should work, but corrupted articles cannot help.  If it
> really works, I tend to revert or investigate.

Think I've spotted it (and my fault :-( Looks like I missed a couple
of of the reads when changing read -> pread and you're not running
with articlemmap.

Here's the patch I'm about to test:

Index: cnfs.c
===================================================================
RCS file: /upstream-repositories/inn-cvs.isc.org/inn/storage/cnfs/cnfs.c,v
retrieving revision 1.84
diff -c -r1.84 cnfs.c
*** cnfs.c	2001/03/29 01:04:10	1.84
--- cnfs.c	2001/04/03 09:41:32
***************
*** 1300,1306 ****
      } else {
  	private->base = NEW(char, ntohl(cah.size));
  	pagefudge = 0;
! 	if (read(cycbuff->fd, private->base, ntohl(cah.size)) < 0) {
  	    SMseterror(SMERR_UNDEFINED, "read failed");
  	    syslog(L_ERROR, "%s: could not read token %s %s:0x%s:%ld: %m",
  		LocalLogName, TokenToText(token), cycbuffname, CNFSofft2hex(offset, FALSE), cycnum);
--- 1300,1307 ----
      } else {
  	private->base = NEW(char, ntohl(cah.size));
  	pagefudge = 0;
! 	if (pread(cycbuff->fd, private->base, ntohl(cah.size),
! 		  offset + sizeof(cah)) < 0) {
  	    SMseterror(SMERR_UNDEFINED, "read failed");
  	    syslog(L_ERROR, "%s: could not read token %s %s:0x%s:%ld: %m",
  		LocalLogName, TokenToText(token), cycbuffname, CNFSofft2hex(offset, FALSE), cycnum);
***************
*** 1628,1634 ****
      } else {
  	private->base = NEW(char, ntohl(cah.size));
  	pagefudge = 0;
! 	if (read(cycbuff->fd, private->base, ntohl(cah.size)) < 0) {
  	    art->data = NULL;
  	    art->len = 0;
  	    art->token = NULL;
--- 1629,1636 ----
      } else {
  	private->base = NEW(char, ntohl(cah.size));
  	pagefudge = 0;
! 	if (read(cycbuff->fd, private->base, ntohl(cah.size),
! 		 offset + sizeof(cah)) < 0) {
  	    art->data = NULL;
  	    art->len = 0;
  	    art->token = NULL;

Whilst I'm about it - does anyone run with OLD_CNFS defined? Or can we
drop it?

-- 
Alex Kiernan, Principal Engineer, Development, Thus PLC


More information about the inn-workers mailing list