NetBSD/sbin
perseant 9c7f8050f4 Various bug-fixes to LFS, to wit:
Kernel:

* Add runtime quantity lfs_ravail, the number of disk-blocks reserved
  for writing.  Writes to the filesystem first reserve a maximum amount
  of blocks before their write is allowed to proceed; after the blocks
  are allocated the reserved total is reduced by a corresponding amount.

  If the lfs_reserve function cannot immediately reserve the requested
  number of blocks, the inode is unlocked, and the thread sleeps until
  the cleaner has made enough space available for the blocks to be
  reserved.  In this way large files can be written to the filesystem
  (or, smaller files can be written to a nearly-full but thoroughly
  clean filesystem) and the cleaner can still function properly.

* Remove explicit switching on dlfs_minfreeseg from the kernel code; it
  is now merely a fs-creation parameter used to compute dlfs_avail and
  dlfs_bfree (and used by fsck_lfs(8) to check their accuracy).  Its
  former role is better assumed by a properly computed dlfs_avail.

* Bounds-check inode numbers submitted through lfs_bmapv and lfs_markv.
  This prevents a panic, but, if the cleaner is feeding the filesystem
  the wrong data, you are still in a world of hurt.

* Cleanup: remove explicit references of DEV_BSIZE in favor of
  btodb()/dbtob().

lfs_cleanerd:

* Make -n mean "send N segments' blocks through a single call to
  lfs_markv".  Previously it had meant "clean N segments though N calls
  to lfs_markv, before looking again to see if more need to be cleaned".
  The new behavior gives better packing of direct data on disk with as
  little metadata as possible, largely alleviating the problem that the
  cleaner can consume more disk through inefficient use of metadata than
  it frees by moving dirty data away from clean "holes" to produce
  entirely clean segments.

* Make -b mean "read as many segments as necessary to write N segments
  of dirty data back to disk", rather than its former meaning of "read
  as many segments as necessary to free N segments worth of space".  The
  new meaning, combined with the new -n behavior described above,
  further aids in cleaning storage efficiency as entire segments can be
  written at once, using as few blocks as possible for segment summaries
  and inode blocks.

* Make the cleaner take note of segments which could not be cleaned due
  to error, and not attempt to clean them until they are entirely free
  of dirty blocks.  This prevents the case in which a cleanerd running
  with -n 1 and without -b (formerly the default) would spin trying
  repeatedly to clean a corrupt segment, while the remaining space
  filled and deadlocked the filesystem.

* Update the lfs_cleanerd manual page to describe all the options,
  including the changes mentioned here (in particular, the -b and -n
  flags were previously undocumented).

fsck_lfs:

* Check, and optionally fix, lfs_avail (to an exact figure) and
  lfs_bfree (within a margin of error) in pass 5.

newfs_lfs:

* Reduce the default dlfs_minfreeseg to 1/20 of the total segments.

* Add a warning if the sgs disklabel field is 16 (the default for FFS'
  cpg, but not usually desirable for LFS' sgs: 5--8 is a better range).

* Change the calculation of lfs_avail and lfs_bfree, corresponding to
  the kernel changes mentioned above.

mount_lfs:

* Add -N and -b options to pass corresponding -n and -b options to
  lfs_cleanerd.

* Default to calling lfs_cleanerd with "-b -n 4".


[All of these changes were largely tested in the 1.5 branch, with the
idea that they (along with previous un-pulled-up work) could be applied
to the branch while it was still in ALPHA2; however my test system has
experienced corruption on another filesystem (/dev/console has gone
missing :^), and, while I believe this unrelated to the LFS changes, I
cannot with good conscience request that the changes be pulled up.]
2000-09-09 04:49:54 +00:00
..
atactl Back out previous two - didn't follow the code properly. 2000-07-13 11:24:40 +00:00
badsect don't use the result of a readdir() after closedir(), from 1999-07-30 15:56:58 +00:00
bim remove extra period in SEE ALL section 2000-07-05 15:45:28 +00:00
ccdconfig warnx?/errx? audit. don't pass variable/function return value alone. 2000-07-07 12:29:09 +00:00
clri change: 1999-04-06 04:54:19 +00:00
disklabel in cmd_name(), put the default prompt into a temporary buffer rather 2000-09-04 02:09:26 +00:00
dmesg If "SMALL" is defined don't include kvm support, primarily for install 2000-06-20 01:49:20 +00:00
dump Working version of aborted dump{,_lfs} join. 1999-10-01 04:35:21 +00:00
dump_lfs Working version of aborted dump{,_lfs} join. 1999-10-01 04:35:21 +00:00
edlabel enable edlabel on sparc64, too. 2000-08-09 11:37:34 +00:00
fastboot fix bad .Xr references 1998-04-29 09:49:10 +00:00
fdisk When fetching the disk's hardware geometry, first attempt the 2000-07-06 17:22:43 +00:00
fsck Copy code across from newfs so that 'fsck sd0a' and similar will work. 1999-04-22 04:20:53 +00:00
fsck_ext2fs Byteswap the group descriptors fields as well. Works again on big-endian 2000-01-31 11:40:12 +00:00
fsck_ffs Fix an evil ugly bug which causes files placed into lost+found to 2000-08-03 14:52:39 +00:00
fsck_lfs Various bug-fixes to LFS, to wit: 2000-09-09 04:49:54 +00:00
fsck_msdos add a prototype for _readfat() added in last commit and make it static, so 2000-04-26 16:45:02 +00:00
fsdb Add a [-n] option, which allows to examine a fs without altering it. 1999-03-09 16:11:47 +00:00
fsirand #include machine/bswap.h and remove -lutil. 1999-01-15 13:32:05 +00:00
ifconfig add two letters in strategically important places, and replace one 2000-08-13 17:17:26 +00:00
init document the conditions for /etc/rc to be called with "autoboot" 2000-04-29 00:47:06 +00:00
ldconfig make ldconfig.c not always fail. 2000-06-01 18:17:06 +00:00
lmcctl remove extra period in SEE ALL section 2000-07-05 15:45:28 +00:00
mbrlabel More include fixups and GCC 2.96 nonsense 2000-07-03 03:37:59 +00:00
mknod More include fixups and GCC 2.96 nonsense 2000-07-03 03:37:59 +00:00
modload sweep of my licenses (userland files w/o only my copyright) for 2000-06-14 17:24:02 +00:00
modunload sweep of my licenses (userland files w/o only my copyright) for 2000-06-14 17:24:02 +00:00
mount Xr for mount_overlay(8) 2000-07-30 15:17:14 +00:00
mount_ados sweep of my licenses (userland files w/o only my copyright) for 2000-06-14 17:24:02 +00:00
mount_cd9660 note addition of rrcaseins in history 2000-07-16 08:20:04 +00:00
mount_ext2fs Don't declare 'extern opt*' getopt variables. 2000-04-14 05:58:01 +00:00
mount_fdesc Regularize error reporting of mount_* commands for failure of mount(2) 1999-06-25 19:28:35 +00:00
mount_ffs Enable -o softdep. 2000-06-15 22:36:46 +00:00
mount_filecore fix up NetBSD RCS Ids to match the standard, and the leading comment as 2000-06-14 06:48:47 +00:00
mount_kernfs Regularize error reporting of mount_* commands for failure of mount(2) 1999-06-25 19:28:35 +00:00
mount_lfs Various bug-fixes to LFS, to wit: 2000-09-09 04:49:54 +00:00
mount_msdos Document the FAT types we support, and add a bugs section (suggested 2000-08-28 15:31:05 +00:00
mount_nfs correct hard-to-understand indentation. 2000-07-16 14:06:08 +00:00
mount_ntfs fix up NetBSD RCS Ids to match the standard, and the leading comment as 2000-06-14 06:48:47 +00:00
mount_null Typos (from OpenBSD) 1999-11-19 22:48:01 +00:00
mount_overlay in SEE ALSO, add missing comma between moun(8) and mount_null(8) 2000-07-30 10:41:29 +00:00
mount_portal Use CMSG_*() correctly when sending file descriptors. 2000-06-05 16:30:43 +00:00
mount_procfs Fixed typo - zonbie -> zombie 2000-06-08 20:43:16 +00:00
mount_umap Update to new mount arguments. 1999-07-08 03:04:39 +00:00
mount_union Regularize error reporting of mount_* commands for failure of mount(2) 1999-06-25 19:28:35 +00:00
newbtconf Pull down the changes I've just accidently commited into 1.5 branch. 2000-08-26 13:45:20 +00:00
newfs Check the number of cylinder group summary area against MAXCSBUFS. fsck and 2000-05-22 10:33:45 +00:00
newfs_lfs Various bug-fixes to LFS, to wit: 2000-09-09 04:49:54 +00:00
newfs_msdos after determining the size of a file being used as a msdosfs, seek back to 1999-07-26 00:28:57 +00:00
nologin Replace the existing version of nologin(8) with a rewrite that was done 1999-07-27 03:56:13 +00:00
ping sync with latest libipsec and kernel. 2000-01-31 14:24:23 +00:00
ping6 For commands and utilities, use EXIT STATUS rather than RETURN VALUES as 2000-09-04 07:30:07 +00:00
raidctl It is impolite to poll in a tight loop. (Thanks to Christos for noting 2000-08-19 19:51:17 +00:00
rcorder Stop parsing once encountered non directive line as documented in man page. 2000-08-04 07:33:55 +00:00
reboot Implement a "poweroff" command which is equivalent to "halt -p", 2000-04-25 14:03:25 +00:00
restore Extract file flags of symbolic link. 2000-07-07 13:24:33 +00:00
rndctl document -s 2000-08-28 13:27:37 +00:00
route Allow INET6 to be used with SMALL without undefined symbols 2000-05-04 18:29:34 +00:00
routed Pull in <md5.h> rather than defining our own MD5 structures (!). 2000-07-27 16:34:31 +00:00
rtsol use getifaddrs. do not leave AF_INET6 listening socket left opened for 2000-02-25 09:19:06 +00:00
savecore time is a struct timeval' not a time_t', so read it in properly. 2000-08-01 16:46:27 +00:00
scsictl Use .Pa. 2000-07-08 10:28:17 +00:00
setkey For commands and utilities, use EXIT STATUS rather than RETURN VALUES as 2000-09-04 07:30:07 +00:00
shutdown backoff rev 1.18 & 1.19 - it's made obsolete by last rc.d changes and using 2000-07-25 19:02:15 +00:00
slattach Use full month names with .Dd, as per mdoc.samples(7). 1999-09-12 18:47:10 +00:00
swapctl Add space in summary printf. 2000-08-19 21:31:58 +00:00
sysctl implement net.inet6.ip6.{anon,low}port{min,max} sysctl variable. 2000-08-26 11:03:45 +00:00
ttyflags sweep of my licenses (userland files w/o only my copyright) for 2000-06-14 17:24:02 +00:00
tunefs Disable (unifdef for now) tunefs -n <disable|enable>, this is done via 2000-06-15 22:37:17 +00:00
umount Adapt to new RPC interface. Use getaddrinfo(), not gethostbyname(). 2000-06-20 00:45:24 +00:00
wsconsctl Fix type of WSKBDIO_?ETENCODING. 2000-07-06 16:30:47 +00:00
Makefile move setkey(8) from usr.sbin to sbin, to enable us to initialize 2000-06-13 15:15:21 +00:00
Makefile.inc pull bsd.own.mk in before LDSTATIC?=-static, so that LDSTATIC can be 1998-03-02 22:03:11 +00:00