summaryrefslogtreecommitdiffstats
path: root/sbin
Commit message (Collapse)AuthorAgeFilesLines
...
* Update to use the new ioctl interface.sos2001-05-172-73/+71
| | | | Add the list command.
* mdoc(7) police: fix markup in revision 1.27.ru2001-05-152-4/+10
|
* Clarify the currently used partition types.grog2001-05-142-10/+38
| | | | Add cross-references to ccd(4) and vinum(8).
* - Split out the {family,socktype}->netid conversion into a separateiedowse2001-05-131-11/+79
| | | | | | | | | function; we now handle unknown protocols more gracefully. - Cache the return from getnetconfigent() so that we don't have to remember to call freenetconfigent() each time. This fixes a memory leak that would cause retrying background mount_nfs processes to slowly increase their memory usage.
* Just notify us once when encountering a partially allocated inode.mckusick2001-05-081-1/+1
|
* Cosmetics: .Dl -> .Li.ru2001-05-071-1/+1
|
* Let ifconfig(8) catch up with the new functionality wherejesper2001-05-051-1/+11
| | | | | | one can specify addresses and netmask in CIDR notation. Submitted by: Dima Dorfman <dima@unixfreak.org>
* Implement slash/CIDR notation for IPv4 and IPv6 addresses.jesper2001-05-041-0/+29
| | | | | | | MFC after: 1 week Reviewed by: phk Obtained from: NetBSD
* * include/elf.h has been repo copied to include/elf-hints.h, and it noobrien2001-05-022-2/+2
| | | | | | | | longer includes machine/elf.h. * consumers of elf.h now use the minimalist elf header possible. This change is motivated by Binutils 2.11.0 and too much clashing over our base elf headers and the Binutils elf headers.
* Implement the -r and -w options as `-o ro' and `-o noro', respectively. Atdd2001-05-021-2/+2
| | | | | | | | | | least in -w's case, simply unsetting the correct bit in init_flags was not enough. The bit may be reset later if, say, the filesystem is marked `ro' in fstab. The command line option should override the fstab setting, but did not. The implementation of -r was changed for consistency. PR: 26886 Reviewed by: archie
* Update usage message with new options.mckusick2001-04-302-2/+2
| | | | Submitted by: Ruslan Ermilov <ru@FreeBSD.org>
* mdoc(7) police: fix markup.ru2001-04-271-877/+818
|
* mdoc(7) police:ru2001-04-271-3/+3
| | | | document date updated, removed history info from the .Os call, cosmetics.
* mdoc(7) police: update document date, sort xrefs, fix markup.ru2001-04-271-5/+11
|
* Added missing no's to the -o options list.ru2001-04-261-6/+7
| | | | Fixed markup.
* mdoc(7) police: fix markup.ru2001-04-261-22/+23
|
* Add support for -F flag (trivial as background check is never possible).mckusick2001-04-251-1/+6
|
* Add support for running foreground (-F) and background (-B) checks.mckusick2001-04-255-49/+219
| | | | | | | | | | | | | | | | | | | | | | | | | | Traditionally, fsck is invoked before the filesystems are mounted and all checks are done to completion at that time. If background checking is available, fsck is invoked twice. It is first invoked at the traditional time, before the filesystems are mounted, with the -F flag to do checking on all the filesystems that cannot do background checking. It is then invoked a second time, after the system has completed going multiuser, with the -B flag to do checking on all the filesystems that can do background checking. Unlike the foreground checking, the background checking is started asynchonously so that other system activity can proceed even on the filesystems that are being checked. At the moment, only the fast filesystem supports background checking. To be able to do background checking, a filesystem must have been running with soft updates, not have been marked as needing a foreground check, and be mounted and writable when the background check is to be done (i.e., not listed as `noauto' in /etc/fstab). These changes are the final piece needed to support background filesystem checking. They will not have any effect until you update your /etc/rc to invoke fsck in its new mode of operation. I am still playing around with exactly what those changes should be and should be committing them later this week.
* Add support for the -F flag which determines whether a specifiedmckusick2001-04-245-83/+117
| | | | | | | | | | | | filesystem needs foreground checking (usually at boot time) or can defer to background checking (after the system is up and running). See the manual page, fsck_ffs(8), for details on the -F and -B options. These options are primarily intended for use by the fsck front end. All output is directed to stdout so that the output is coherent when redirected to a file or a pipe. Unify the code with the fsck front end that allows either a device or a mount point to be specified as the argument to be checked.
* Say "add -r" rather than 'use -r' since the former is more correct.imp2001-04-242-4/+2
| | | | | The latter implies to many people that they use only -r, which is incorrect.
* sprintf() -> snprintf()kris2001-04-242-3/+3
| | | | | Partially submitted by: "Andrew R. Reiter" <arr@watson.org> Obtained from: OpenBSD
* In fsdb, call sblock_init() which is now necessary to initialiseiedowse2001-04-233-0/+3
| | | | | the global variable dev_bsize. Add a prototype for sblock_init() to fsck.h, and set the return type correctly.
* Reinstate one more old bugfix that got lost in the tirpc commit:iedowse2001-04-231-15/+20
| | | | | | | always look up -network and -mask addresses numerically before trying getnetbyname(). Without this, we may end up attempting DNS queries on silly names such as "127.0.0.0.my-domain.com". See the commit log from revisions 1.21 and 1.20 for further details.
* When exporting a directory that is not a mountpoint, mountd repeatedlyiedowse2001-04-221-0/+8
| | | | | | | | | | | | | removes the last path component until the mount() succeeds. However, the code never checks if it has passed the mountpoint, so in some cases where the mount() never succeeds, it can end up applying the flags from a mounted filesystem to the underlying one. Add a sanity check to the code which removes the last path component: test that the fsid associated with the new path is the same as that of the old one. PR: bin/7872
* The introduction of IPv6 support from NetBSD's mountd invalidatediedowse2001-04-211-243/+207
| | | | | | | | | | | | | | | | | | | | | | | | a number of assumptions related to the parsing of options in /etc/exports, and missed a few necessary new error checks. The main problems related to netmasks: an IPv6 network address missing a netmask would result in the filesystem being exported to the whole IPv6 world, non-continuous netmasks would be made continuous without any warnings, and nothing prevented you specifying an IPv4 mask with an IPv6 address. This change addresses these issues. As a side-effect we now store netmasks in sockaddr structs (this matches the kernel interface, and is closer to the way it used to be). Add a flag OP_HAVEMASK to keep track of whether or not we have successfully got a mask from any source. Replace some mask-related helper functions with versions that use the sockaddr-based masks. Also tidy up get_net() and fix the code that interprets IPv4 partial networks such as "127.1" as network rather than host addresses. Properly zero out some structures that were ending up partially containing junk from the stack, fix a few formatting issues, and add a comment noting some assumptions about export arguments.
* Fix a long-standing bug relating to the handling of SIGHUP: mountdiedowse2001-04-211-4/+30
| | | | | | | | | | would call malloc, stdio and other library functions from the signal handler which is not safe due to reentrancy problems. Instead, add a simple handler that just sets a flag, and call the more complex function from main() when necessary. Unfortunately to be able to check this flag, we must expand the svc_run() call, but the RPC library makes that relatively easy to do.
* Fix bogon with the nodump flag.jkh2001-04-191-5/+10
| | | | Submitted by: Dima Dorfman <dima@unixfreak.org>
* mdoc(7) police: normalize .Nd.ru2001-04-187-11/+7
|
* A few more mountd cleanups:iedowse2001-04-181-37/+17
| | | | | | | | | | | | - Remove some horrible code that faked a "struct addrinfo" to be later passed to freeaddrinfo(). Instead, add a new group type "GT_DEFAULT" used to denote that the filesystem is exported to the world, and treat this case separately. - Don't clear the AI_CANONNAME flag in a struct addrinfo returned by getaddrinfo. There's still a bit more struct addrinfo abuse left in here. - Simplify do_mount() slightly by using an addrinfo pointer to keep track of the current address.
* Various bugfixes and cleanups, mainly from Martin Blapp:iedowse2001-04-171-68/+47
| | | | | | | | | | | | | | | | | - Revert del_mlist() to its pre-tirpc prototype. Unlike NetBSD's version, ours lets the caller generate any syslog() messages, so that it can include the service name in the message. - Initialise a few local variables to clarify the logic and avoid some compiler warnings. - Remove a few unused functions and local variables, and fix some whitespace issues. - Reinstate the logic for avoiding duplicate host entries that got removed accidentally in revision 1.41 (added in r1.5). This bit was submitted in a slightly different form by Thomas Quinot. Submitted by: Martin Blapp <mb@imp.ch>, Thomas Quinot <quinot@inf.enst.fr> PR: bin/26148
* Add a missing argument to an error message format string.kris2001-04-171-1/+1
|
* Minor background cleanups:mckusick2001-04-165-30/+87
| | | | | | | | | | | 1) Set the FS_NEEDSFSCK flag when unexpected problems are encountered. 2) Clear the FS_NEEDSFSCK flag after a successful foreground cleanup. 3) Refuse to run in background when the FS_NEEDSFSCK flag is set. 4) Avoid taking and removing a snapshot when the filesystem is already clean. 5) Properly implement the force cleaning (-f) flag when in preen mode. Note that you need to have revision 1.21 (date: 2001/04/14 05:26:28) of fs.h installed in <ufs/ffs/fs.h> defining FS_NEEDSFSCK for this to compile.
* mdoc(7) police: prepare for mdocNG.ru2001-04-162-2/+2
|
* Do not allow the soft updates flag to be set if the filesystem is dirty.mckusick2001-04-131-1/+4
| | | | | | | | | | | Because the kernel will allow the mounting of unclean filesystems when the soft updates flag is set, it is important that only soft updates style inconsistencies (missing blocks and inodes) be present. Otherwise a panic may ensue. It is also important that the filesystem be in a clean state when the soft updates flag is set because the background fsck uses the fact that the flag is set to indicate that it is safe to run. If background fsck encounters non-soft updates style inconsistencies, it will exit with unexpected inconsistencies.
* mdoc(7) police: properly use a -diag list in the DIAGNOSTICS section.dd2001-04-131-7/+7
| | | | Reviewed by: ru
* Back out most of revision 1.28: lists of diagnostics must use -diag,dd2001-04-131-4/+3
| | | | | | | not -tag. Instead, put a period after the error messages to aide those using dumb terminals not capable of properly displaying markup. Requested by: ru
* Update comment to match ipfw/ipfw.c,v 1.95.ru2001-04-132-6/+4
|
* Match ip6fw's command line options to those of ipfw (specifically, addedgshapiro2001-04-132-21/+176
| | | | | | | | | | the ability to use a preprocessor, use the -q (quiet) flag when reading from a file). The source used is from ipfw. Clean up exit codes while I am here. KAME has been informed and plans on integrating these patches into their own source as well.
* Fix a typo relating to the "-U" (force UDP for mount protocol)iedowse2001-04-111-6/+7
| | | | | option. When specified, make sure to use the correct netid for the getnetconfigent() call, and also in error messages.
* Catch up to the dirpref changes by copying new fields in the alternatejhb2001-04-101-0/+3
| | | | | superblock from the original superblock so that differences in those new fields are ignored.
* Split out all the RPC code into a separate function and address aiedowse2001-04-101-233/+275
| | | | | | | | | | | | | | | | | number of issues: - Fix background mounts; these were broken in revision 1.40. - Don't give up before trying all addresses returned by getaddrinfo(). - Use protocol-independent routines where possible. - Improve error reporting for RPC errors. - In non-background mode, give up after trying all protocols once. - Use daemon(3) instead of rolling our own version. - Never go ahead with the mount() syscall until we have received a reply from the remote nfsd; this is especially important with non-interruptible mounts, as otherwise a mistyped command might require a reboot to correct. Reviewed by: alfred, Martin Blapp <mb@imp.ch>
* vnconfig(8) -> mdconfig(8).ru2001-04-101-8/+6
|
* Add information about the new options to newfs and tunefs which set thenik2001-04-102-0/+12
| | | | | expected average file size and number of files per directory. Could do with some fleshing out.
* Directory layout preference improvements from Grigoriy Orlov <gluk@ptci.ru>.mckusick2001-04-103-11/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | His description of the problem and solution follow. My own tests show speedups on typical filesystem intensive workloads of 5% to 12% which is very impressive considering the small amount of code change involved. ------ One day I noticed that some file operations run much faster on small file systems then on big ones. I've looked at the ffs algorithms, thought about them, and redesigned the dirpref algorithm. First I want to describe the results of my tests. These results are old and I have improved the algorithm after these tests were done. Nevertheless they show how big the perfomance speedup may be. I have done two file/directory intensive tests on a two OpenBSD systems with old and new dirpref algorithm. The first test is "tar -xzf ports.tar.gz", the second is "rm -rf ports". The ports.tar.gz file is the ports collection from the OpenBSD 2.8 release. It contains 6596 directories and 13868 files. The test systems are: 1. Celeron-450, 128Mb, two IDE drives, the system at wd0, file system for test is at wd1. Size of test file system is 8 Gb, number of cg=991, size of cg is 8m, block size = 8k, fragment size = 1k OpenBSD-current from Dec 2000 with BUFCACHEPERCENT=35 2. PIII-600, 128Mb, two IBM DTLA-307045 IDE drives at i815e, the system at wd0, file system for test is at wd1. Size of test file system is 40 Gb, number of cg=5324, size of cg is 8m, block size = 8k, fragment size = 1k OpenBSD-current from Dec 2000 with BUFCACHEPERCENT=50 You can get more info about the test systems and methods at: http://www.ptci.ru/gluk/dirpref/old/dirpref.html Test Results tar -xzf ports.tar.gz rm -rf ports mode old dirpref new dirpref speedup old dirprefnew dirpref speedup First system normal 667 472 1.41 477 331 1.44 async 285 144 1.98 130 14 9.29 sync 768 616 1.25 477 334 1.43 softdep 413 252 1.64 241 38 6.34 Second system normal 329 81 4.06 263.5 93.5 2.81 async 302 25.7 11.75 112 2.26 49.56 sync 281 57.0 4.93 263 90.5 2.9 softdep 341 40.6 8.4 284 4.76 59.66 "old dirpref" and "new dirpref" columns give a test time in seconds. speedup - speed increasement in times, ie. old dirpref / new dirpref. ------ Algorithm description The old dirpref algorithm is described in comments: /* * Find a cylinder to place a directory. * * The policy implemented by this algorithm is to select from * among those cylinder groups with above the average number of * free inodes, the one with the smallest number of directories. */ A new directory is allocated in a different cylinder groups than its parent directory resulting in a directory tree that is spreaded across all the cylinder groups. This spreading out results in a non-optimal access to the directories and files. When we have a small filesystem it is not a problem but when the filesystem is big then perfomance degradation becomes very apparent. What I mean by a big file system ? 1. A big filesystem is a filesystem which occupy 20-30 or more percent of total drive space, i.e. first and last cylinder are physically located relatively far from each other. 2. It has a relatively large number of cylinder groups, for example more cylinder groups than 50% of the buffers in the buffer cache. The first results in long access times, while the second results in many buffers being used by metadata operations. Such operations use cylinder group blocks and on-disk inode blocks. The cylinder group block (fs->fs_cblkno) contains struct cg, inode and block bit maps. It is 2k in size for the default filesystem parameters. If new and parent directories are located in different cylinder groups then the system performs more input/output operations and uses more buffers. On filesystems with many cylinder groups, lots of cache buffers are used for metadata operations. My solution for this problem is very simple. I allocate many directories in one cylinder group. I also do some things, so that the new allocation method does not cause excessive fragmentation and all directory inodes will not be located at a location far from its file's inodes and data. The algorithm is: /* * Find a cylinder group to place a directory. * * The policy implemented by this algorithm is to allocate a * directory inode in the same cylinder group as its parent * directory, but also to reserve space for its files inodes * and data. Restrict the number of directories which may be * allocated one after another in the same cylinder group * without intervening allocation of files. * * If we allocate a first level directory then force allocation * in another cylinder group. */ My early versions of dirpref give me a good results for a wide range of file operations and different filesystem capacities except one case: those applications that create their entire directory structure first and only later fill this structure with files. My solution for such and similar cases is to limit a number of directories which may be created one after another in the same cylinder group without intervening file creations. For this purpose, I allocate an array of counters at mount time. This array is linked to the superblock fs->fs_contigdirs[cg]. Each time a directory is created the counter increases and each time a file is created the counter decreases. A 60Gb filesystem with 8mb/cg requires 10kb of memory for the counters array. The maxcontigdirs is a maximum number of directories which may be created without an intervening file creation. I found in my tests that the best performance occurs when I restrict the number of directories in one cylinder group such that all its files may be located in the same cylinder group. There may be some deterioration in performance if all the file inodes are in the same cylinder group as its containing directory, but their data partially resides in a different cylinder group. The maxcontigdirs value is calculated to try to prevent this condition. Since there is no way to know how many files and directories will be allocated later I added two optimization parameters in superblock/tunefs. They are: int32_t fs_avgfilesize; /* expected average file size */ int32_t fs_avgfpdir; /* expected # of files per directory */ These parameters have reasonable defaults but may be tweeked for special uses of a filesystem. They are only necessary in rare cases like better tuning a filesystem being used to store a squid cache. I have been using this algorithm for about 3 months. I have done a lot of testing on filesystems with different capacities, average filesize, average number of files per directory, and so on. I think this algorithm has no negative impact on filesystem perfomance. It works better than the default one in all cases. The new dirpref will greatly improve untarring/removing/coping of big directories, decrease load on cvs servers and much more. The new dirpref doesn't speedup a compilation process, but also doesn't slow it down. Obtained from: Grigoriy Orlov <gluk@ptci.ru>
* Make the list in the DIAGNOSTICS section "-tag" instead of "-diag":dd2001-04-101-2/+2
| | | | | | | the former makes it more obvious as to there the error message starts and the explanation begins. PR: 26431
* wd0 -> ad0dd2001-04-082-4/+4
| | | | | PR: 26343 Submitted by: Sergey A. Osokin <osa@FreeBSD.org.ru>
* Don't make fsck go quite _that_ fast:phk2001-04-071-1/+3
| | | | In Preen mode we only checked one partition per disk device.
* beforeinstall -> SCRIPTS.ru2001-04-073-20/+7
|
* Fixed some printf format errors (don't assume that ntohl() returns u_long).bde2001-04-051-2/+2
|
* mdoc(7) police: use .Nm instead of hardcoded name.ru2001-04-041-1/+3
|
OpenPOWER on IntegriCloud