Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 Dec 1997 10:40:02 -0800 (PST)
From:      Cy Schubert - ITSD Open Systems Group <cschuber@uumail.gov.bc.ca>
To:        freebsd-bugs
Subject:   Re: kern/5355: Fix for NULLFS problems 
Message-ID:  <199712221840.KAA14709@hub.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/5355; it has been noted by GNATS.

From: Cy Schubert - ITSD Open Systems Group <cschuber@uumail.gov.bc.ca>
To: Bruce Evans <bde@zeta.org.au>
Cc: cschuber@uumail.gov.bc.ca, freebsd-gnats-submit@freebsd.org,
        cy@passer.osg.gov.bc.ca
Subject: Re: kern/5355: Fix for NULLFS problems 
Date: Mon, 22 Dec 1997 10:35:40 -0800

 I'll give your code a try.
 
 Would it be a good idea to to have a panic() or a printf() where I return a 
 FALSE?  I'm torn between providing better diagnostic messages and reducing 
 kernel bloat.  By doing a printf() or panic() any author of a filesystem would 
 know that he would need to do some work on his code.
 
 
 Regards,                       Phone:  (250)387-8437
 Cy Schubert                      Fax:  (250)387-5766
 UNIX Support                   OV/VM:  BCSC02(CSCHUBER)
 ITSD                          BITNET:  CSCHUBER@BCSC02.BITNET
 Government of BC            Internet:  cschuber@uumail.gov.bc.ca
                                        Cy.Schubert@gems8.gov.bc.ca
 
 		"Quit spooling around, JES do it."
 
 > >>Fix:
 > >cwsys# cat /opt/archives-3/usermods/nullfs_panic_fix.usermod 
 > >--- src/sys/vm/vnode_pager.c.orig2      Sun Dec  7 13:11:03 1997
 > >+++ src/sys/vm/vnode_pager.c    Fri Dec 19 06:30:27 1997
 > >@@ -231,10 +231,12 @@
 > >        blocksperpage = 0;
 > >        if (pagesperblock > 0) {
 > >                reqblock = pindex / pagesperblock;
 > >-       } else {
 > >+       } else if (bsize > 0)  {
 > >                blocksperpage = (PAGE_SIZE / bsize);
 > >                reqblock = pindex * blocksperpage;
 > >-       }
 > >+       } else
 > >+               return FALSE;
 > >+
 > 
 > I think bsize is supposed to be > 0 here.  Lots of other places depend
 > on vp->v_mount->mnt_stat.f_iosize being reasonable.  nullfs and some
 > other file systems (portal and umapfs at least) just don't initialize
 > most of mnt_stat (except by bzeroing it).  This untested fix for nullfs
 > was obtained from union[fs].
 > 
 > diff -c2 null_vfsops.c~ null_vfsops.c
 > *** null_vfsops.c~	Mon Oct 13 21:46:00 1997
 > --- null_vfsops.c	Mon Dec 22 04:32:11 1997
 > ***************
 > *** 199,202 ****
 > --- 199,203 ----
 >   	    &size);
 >   	bzero(mp->mnt_stat.f_mntfromname + size, MNAMELEN - size);
 > + 	(void)nullfs_statfs(mp, &mp->mnt_stat, p);
 >   #ifdef NULLFS_DIAGNOSTIC
 >   	printf("nullfs_mount: lower %s, alias at %s\n",
 > 
 > Bruce
 
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199712221840.KAA14709>