From owner-freebsd-bugs Fri Jan 31 08:22:12 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id IAA29080 for bugs-outgoing; Fri, 31 Jan 1997 08:22:12 -0800 (PST) Received: from visitor-4.sp.cs.cmu.edu (VISITOR-4.SP.CS.CMU.EDU [128.2.198.195]) by freefall.freebsd.org (8.8.5/8.8.5) with SMTP id IAA29072 for ; Fri, 31 Jan 1997 08:22:04 -0800 (PST) Message-Id: <199701311622.IAA29072@freefall.freebsd.org> Received: from localhost by visitor-4.sp.cs.cmu.edu id aa10523; 31 Jan 97 11:21 EST To: freebsd-bugs@freebsd.org Reply-To: th+@cs.cmu.edu Subject: mount_mfs Date: Fri, 31 Jan 1997 11:21:26 -0500 From: tatsuya Hagino Sender: owner-bugs@freebsd.org X-Loop: FreeBSD.org Precedence: bulk I am currently developing a 4.4BSD Lite Server for RT-Mach and making it to work with FreeBSD 2.2-BETA. I found a bug in mount_mfs command (whith is the same as newfs). When it creates a memory file system, it issues a mount system call but the size field is twice as small as it should be. In /usr/src/sbin/newfs/mkfs.c line 460, fssize is converted from sector size to file system block size (which is tipically 1024 byte). sblock.fs_size = fssize = dbtofsb(&sblock, fssize); However, mount system call argument is caliculated in /usr/src/sbin/newfs/newfs.c line 554 args.size = fssize * sectorsize; where it uses the sector size (512 byte). This confusion of sector size and file system block size is causing the problem. The reason why FreeBSD mount_mfs works is that FreeBSD kernel does not check the size limit in mfs_vnops.c. I have found this bug when I was implementing the memory file system for Lites and Lites hanged because of illegal memory accesses. Tatsuya Hagino P.S. Could you also change the fspec name? Since the special file name for a memory file system is "mfs:", the kernel tries to find the host name "mfs" when it shut down (it looks like nfs mount). If the machine is disconnected from the network, the name resolution (which failes) takes quite a time. ---------------------------------------------------------------------------- Tatsuya Hagino th+@cs.cmu.edu hagino@sfc.keio.ac.jp School of Computer Science Fuculty of Environmental Information Carnegie Mellon University Keio University 5000 Forbes Ave. Pittsburgh, PA 15213 5322 Endoh, Fujisawa, Kanagawa 252