Subject: RE: cp caused a panic
To: 'Brian Stark' <bstark@empros.com>
From: None <"John A. Maier - Kemper Military School and College MIS dept.">
List: netbsd-help
Date: 06/09/1997 14:31:17
Hey, back in the 0.9 days (First Datastorm UNIX box) I had all kinds of DOS to ufs copy troubles.  1.1 NetBSD seemed to fix those problems.


Actually I did a ...
kemper.org:/usr/include>grep MAXBSIZE `find ./ -name "*.h" -print`
and got...
.//sys/param.h: * The file system is made out of blocks of at most MAXBSIZE units, with
.//sys/param.h: * smaller units (fragments) only in the last direct block.  MAXBSIZE
.//sys/param.h:#define  MAXBSIZE        16384 /* XXX MAXPHYS */
.//sys/param.h: * and must be less than or equal to MAXBSIZE.  MAXSYMLINKS defines the
.//ufs/ffs/fs.h: * of `blocks'. File system blocks of at most size MAXBSIZE can 
.//ufs/ffs/fs.h: * and that both SBSIZE and MAXBSIZE must be >= MINBSIZE.
.//sys.2/param.h: * The file system is made out of blocks of at most MAXBSIZE units, with
.//sys.2/param.h: * smaller units (fragments) only in the last direct block.  MAXBSIZE
.//sys.2/param.h:#define        MAXBSIZE        16384 /* XXX MAXPHYS */
.//sys.2/param.h: * and must be less than or equal to MAXBSIZE.  MAXSYMLINKS defines the
.//sys.2/kobj.h:#define B_OFFSET(f_offset) (f_offset & (MAXBSIZE-1))    /* Offset into buffer */
.//sys.2/kobj.h:#define F_PAGE(f_offset)   (f_offset & ~(MAXBSIZE-1))   /* Start of page */

Basically I have no idea!

jam

----------
From:  Brian Stark[SMTP:bstark@empros.com]
Sent:  Monday, June 09, 1997 5:17 AM
To:  netbsd-help@netbsd.org
Cc:  netbsd-i386@netbsd.org
Subject:  cp caused a panic

Hello

I am running NetBSD 1.2.1/i386 and my kernel decided to panic last night 
when I was copying a file. I am wondering if anyone has any ideas as to why 
this happened. Here's what I did/saw:

  cp /seagate/gpc20.tgz .
  panic: allocbuf: buffer larger than MAXBSIZE requested.
  stopped at _Debugger+0x4: leave

Also, after I had rebooted my machine, I noticed that the file gpc20.tgz
no longer existed under /seagate. The gpc20.tgz file is 1,710,665 bytes and 
/seagate is a 2GB MS-DOS file system, formatted by Win95. I was copying the 
file to a 3GB Western Digital hard drive that has two partitions -- one for 
Win95 (about 2GB in size) and the other for NetBSD (about 1GB in size). The 
NetBSD partition has about 500MB free, so there is no shortage of disk space.

I have copied large files before on my WD drive, and cp has not caused a 
panic. This is my first time copying files between my Seagate and the WD 
drive. Is there something obviously wrong with what I am doing? If it 
helps at all, I mount my Seagate drive like this in /etc/fstab:

  "/dev/wd1e /seagate msdos rw"

Right now it looks like I need to increase the value of MAXBSIZE and try 
again (where is this defined?), but I am wondering what the cp code is 
doing... Copying a file isn't that difficult, you read from the source file 
and write to the target file until finished processing the source file.
Does cp try to allocate one buffer to copy the entire file at once?


Thanks,

Brian

-------------------------------------------------------------------------
| Brian Stark                       | Internet : bstark@siemens-psc.com |
| Siemens Energy & Automation, Inc. |          : bstark@empros.com      |
| Power Systems Control Division    |                                   |
| 7225 Northland Drive              | Voice    : +1 612 536-4697        |
| Brooklyn Park, MN 55428   USA     | Fax      : +1 612 536-4919        |
-------------------------------------------------------------------------