Subject: CVS commit: [netbsd-2] src
To: None <source-changes@NetBSD.org>
From: Jeff Rizzo <riz@netbsd.org>
List: source-changes
Date: 05/10/2005 05:08:58
Module Name:	src
Committed By:	riz
Date:		Tue May 10 05:08:58 UTC 2005

Modified Files:
	src/libexec/lfs_cleanerd [netbsd-2]: clean.h cleanerd.c library.c
	src/regress/sys/fs/lfs/newfs_fsck [netbsd-2]: Makefile mkfs_mount
	    smallfiles
	src/sbin/fsck_lfs [netbsd-2]: bufcache.c bufcache.h lfs.c lfs.h pass0.c
	    pass3.c segwrite.c setup.c utilities.c
	src/sbin/newfs_lfs [netbsd-2]: Makefile newfs.c
	src/sys/ufs/lfs [netbsd-2]: TODO lfs.h lfs_alloc.c lfs_balloc.c
	    lfs_bio.c lfs_extern.h lfs_segment.c lfs_subr.c lfs_syscalls.c
	    lfs_vfsops.c lfs_vnops.c
	src/sys/ufs/ufs [netbsd-2]: ufs_readwrite.c
Added Files:
	src/sbin/newfs_lfs [netbsd-2]: make_lfs.c
Removed Files:
	src/sbin/newfs_lfs [netbsd-2]: lfs.c

Log Message:
Pull up the following revisions (requested by perseant in ticket #1281):

        1.8 sys/ufs/lfs/TODO
        1.75 sys/ufs/lfs/lfs.h                  (via patch)
        1.74 sys/ufs/lfs/lfs_alloc.c            (via patch)
        1.49, 1.51 sys/ufs/lfs/lfs_balloc.c     (1.51 via patch)
        1.78 sys/ufs/lfs/lfs_bio.c
        1.62 sys/ufs/lfs/lfs_extern.h           (via patch)
        1.156 sys/ufs/lfs/lfs_segment.c         (via patch)
        1.48 sys/ufs/lfs/lfs_subr.c
        1.101 sys/ufs/lfs/lfs_syscalls.c
        1.163 sys/ufs/lfs/lfs_vfsops.c          (via patch)
        1.134 sys/ufs/lfs/lfs_vnops.c           (via patch)
        1.61 sys/ufs/ufs/ufs_readwrite.c        (via patch)

        1.20 libexec/lfs_cleanerd/clean.h       (via patch)
        1.52 libexec/lfs_cleanerd/cleanerd.c    (via patch)
        1.41 libexec/lfs_cleanerd/library.c     (via patch)

        1.4 regress/sys/fs/lfs/newfs_fsck/Makefile
        1.2 regress/sys/fs/lfs/newfs_fsck/mkfs_mount
        1.2 regress/sys/fs/lfs/newfs_fsck/smallfiles
        1.3 sbin/fsck_lfs/bufcache.c
        1.3 sbin/fsck_lfs/bufcache.h
        1.3 sbin/fsck_lfs/lfs.h
        1.8 sbin/fsck_lfs/lfs.c                 (via patch)
        1.8 sbin/fsck_lfs/pass3.c               (via patch)
        1.18 sbin/fsck_lfs/pass0.c              (via patch)
        1.18 sbin/fsck_lfs/utilities.c          (via patch)
        1.7 sbin/fsck_lfs/segwrite.c
        1.19 sbin/fsck_lfs/setup.c              (via patch)
        1.3 sbin/newfs_lfs/Makefile
        0 sbin/newfs_lfs/lfs.c                  (yes, remove it)
        1.1 sbin/newfs_lfs/make_lfs.c
        1.15 sbin/newfs_lfs/newfs.c             (via patch)

Various minor LFS improvements.

Kernel:

* Note when lfs_putpages(9) thinks it is not going to be writing any
   pages before calling genfs_putpages(9).  This prevents a situation in
   which blocks can be queued for writing without a segment header.
* Correct computation of NRESERVE(), though it is still a gross
   overestimate in most cases.  Note that if NRESERVE() is too high, it
   may be impossible to create files on the filesystem.  We catch this
   case on filesystem mount and refuse to mount r/w.
* Allow filesystems to be mounted whose block size is == MAXBSIZE.
* Somewhere along the line, ufs_bmaparray(9) started mangling UNWRITTEN
   entries in indirect blocks again, triggering a failed assertion "daddr
   <= LFS_MAX_DADDR".  Explicitly convert to and from int32_t to correct
   this.  Should fix PR #29045.
* Add a high-water mark for the number of dirty pages any given LFS can
   hold before triggering a flush.  This is settable by sysctl, but off
   (zero) by default.
* Be more careful about the MAX_BYTES and MAX_BUFS computations so we
   shouldn't see "please increase to at least zero" messages.
* Note that VBLK and VCHR vnodes can have nonzero values in di_db[0]
   even though their v_size == 0.  Don't panic when we see this.
   Fixes PR #26680.
* Change lfs_bfree to a signed quantity.  The manner in which it is
   processed before being passed to the cleaner means that sometimes it
   may drop below zero, and the cleaner must be aware of this.
* Never report bfree < 0 (or higher than lfs_dsize) through
   lfs_statfs(9).  This prevents df(1) from ever telling us that our full
   filesystems have 16TB free.
* Account space allocated through lfs_balloc(9) that does not have
   associated buffer headers, so that the pagedaemon doesn't run us out
   of segments.
* Return ENOSPC from lfs_balloc(9) when bfree drops to zero.
* Address a deadlock in lfs_bmapv/lfs_markv when the filesystem is being
   unmounted.  Because vfs_busy() is a shared lock, and
   lfs_bmapv/lfs_markv mark the filesystem vfs_busy(), the cleaner can be
   holding the lock that umount() is blocking on, then try to vfs_busy()
   again in getnewvnode().

cleaner:

* Adapt lfs_cleanerd to use the fcntl call to get the Ifile filehandle,
   so it need not be in the namespace.
* Make lfs_cleanerd be more careful when there are very few available
   segments.
* Make lfs_cleanerd less verbose when the filesystem is unmounted.

newfs_lfs, fsck_lfs, and regression:

* Extend the lfs library from fsck_lfs(8) so that it can be used with a
   not-yet-existent LFS.  Make newfs_lfs(8) use this library, so it can
   create LFSs whose Ifile is larger than one segment.  Addresses PR #11110.
* Make newfs_lfs(8) use strsuftoi64() for its arguments, a la newfs(8).
* Make fsck_lfs(8) respect the "file system is clean" flag.
* Don't let fsck_lfs(8) think it has dirty blocks when invoked with the
   -n flag.
* Remove the Ifile from the filesystem namespace.  The cleaner now uses
   a fcntl call on the root inode to find the Ifile filehandle.  (As a
   side-effect, addresses PR #29144.)


To generate a diff of this commit:
cvs rdiff -r1.18 -r1.18.4.1 src/libexec/lfs_cleanerd/clean.h
cvs rdiff -r1.50 -r1.50.4.1 src/libexec/lfs_cleanerd/cleanerd.c
cvs rdiff -r1.39 -r1.39.4.1 src/libexec/lfs_cleanerd/library.c
cvs rdiff -r1.3 -r1.3.4.1 src/regress/sys/fs/lfs/newfs_fsck/Makefile
cvs rdiff -r1.1 -r1.1.4.1 src/regress/sys/fs/lfs/newfs_fsck/mkfs_mount \
    src/regress/sys/fs/lfs/newfs_fsck/smallfiles
cvs rdiff -r1.2 -r1.2.4.1 src/sbin/fsck_lfs/bufcache.c \
    src/sbin/fsck_lfs/bufcache.h src/sbin/fsck_lfs/lfs.h
cvs rdiff -r1.7 -r1.7.4.1 src/sbin/fsck_lfs/lfs.c
cvs rdiff -r1.16 -r1.16.4.1 src/sbin/fsck_lfs/pass0.c \
    src/sbin/fsck_lfs/utilities.c
cvs rdiff -r1.5 -r1.5.4.1 src/sbin/fsck_lfs/pass3.c
cvs rdiff -r1.6 -r1.6.4.1 src/sbin/fsck_lfs/segwrite.c
cvs rdiff -r1.17 -r1.17.4.1 src/sbin/fsck_lfs/setup.c
cvs rdiff -r1.2 -r1.2.4.1 src/sbin/newfs_lfs/Makefile
cvs rdiff -r1.33 -r0 src/sbin/newfs_lfs/lfs.c
cvs rdiff -r0 -r1.3.2.1 src/sbin/newfs_lfs/make_lfs.c
cvs rdiff -r1.13 -r1.13.4.1 src/sbin/newfs_lfs/newfs.c
cvs rdiff -r1.7 -r1.7.8.1 src/sys/ufs/lfs/TODO
cvs rdiff -r1.72 -r1.72.4.1 src/sys/ufs/lfs/lfs.h src/sys/ufs/lfs/lfs_alloc.c
cvs rdiff -r1.48 -r1.48.6.1 src/sys/ufs/lfs/lfs_balloc.c
cvs rdiff -r1.77 -r1.77.6.1 src/sys/ufs/lfs/lfs_bio.c
cvs rdiff -r1.59.2.1 -r1.59.2.1.2.1 src/sys/ufs/lfs/lfs_extern.h
cvs rdiff -r1.152 -r1.152.4.1 src/sys/ufs/lfs/lfs_segment.c
cvs rdiff -r1.47 -r1.47.6.1 src/sys/ufs/lfs/lfs_subr.c
cvs rdiff -r1.100 -r1.100.6.1 src/sys/ufs/lfs/lfs_syscalls.c
cvs rdiff -r1.146.2.1 -r1.146.2.1.2.1 src/sys/ufs/lfs/lfs_vfsops.c
cvs rdiff -r1.129 -r1.129.4.1 src/sys/ufs/lfs/lfs_vnops.c
cvs rdiff -r1.55 -r1.55.4.1 src/sys/ufs/ufs/ufs_readwrite.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.