Commit Graph

152 Commits

Author SHA1 Message Date
pooka fe44f86a99 in const where available 2009-08-06 00:55:08 +00:00
pooka 709a4d5bb6 Define syscalls of lfs userspace tools (cleaner, mainly) through
a struct called kernelops, which contains standard system calls
for the normal case and rump system calls for the rump case.

Make it possible to run the lfs cleaner in a library fashion (taking
the quick route with the implementation).
2009-08-06 00:51:55 +00:00
lukem ef685eeea9 Enable WARNS=4 by default except for:
dump  dump_lfs  fsck_ffs  fsck_lfs  fsdb  mount_smbfs
	newfs_ext2fs  newfs_lfs  resize_lfs  setkey
2009-04-11 07:58:11 +00:00
joerg d7eb1430e2 Fix markup. 2009-03-15 10:01:47 +00:00
ad 59fcf21389 PR kern/26878 FFSv2 + softdep = livelock (no free ram)
PR kern/16942 panic with softdep and quotas
PR kern/19565 panic: softdep_write_inodeblock: indirect pointer #1 mismatch
PR kern/26274 softdep panic: allocdirect_merge: ...
PR kern/26374 Long delay before non-root users can write to softdep partitions
PR kern/28621 1.6.x "vp != NULL" panic in ffs_softdep.c:4653 while unmounting a softdep (+quota) filesystem
PR kern/29513 FFS+Softdep panic with unfsck-able file-corruption
PR kern/31544 The ffs softdep code appears to fail to write dirty bits to disk
PR kern/31981 stopping scsi disk can cause panic (softdep)
PR kern/32116 kernel panic in softdep (assertion failure)
PR kern/32532 softdep_trackbufs deadlock
PR kern/37191 softdep: locking against myself
PR kern/40474 Kernel panic after remounting raid root with softdep

Retire softdep, pass 2. As discussed and later formally announced on the
mailing lists.
2009-02-22 20:28:05 +00:00
wiz af2c2b73f3 Don't use unicode in usage.
Noted by Anon Ymous.
2008-10-12 20:49:43 +00:00
wiz 89cc13767c Sync usage with man page. 2008-10-09 18:38:24 +00:00
christos 59334248e2 Disable userid to username lookups by default. Add a -U flag to perform them.
In single user mode lookups that involve the network might not work and they
slow down fsck.
2008-10-09 16:56:23 +00:00
hannken 5d2bff060a Make sure all cached buffers with valid, not yet written data have been
run through copy-on-write.  Call fscow_run() with valid data where possible.

The LP_UFSCOW hack is no longer needed to protect ffs_copyonwrite() against
endless recursion.

- Add a flag B_MODIFY to bread(), breada() and breadn().  If set the caller
  intends to modify the buffer returned.

- Always run copy-on-write on buffers returned from ffs_balloc().

- Add new function ffs_getblk() that gets a buffer, assigns a new blkno,
  may clear the buffer and runs copy-on-write.  Process possible errors
  from getblk() or fscow_run().  Part of PR kern/38664.

Welcome to 4.99.63

Reviewed by: YAMAMOTO Takashi <yamt@netbsd.org>
2008-05-16 09:21:59 +00:00
martin ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
lukem 481ad7b03a errexit() now provides the trailing \n (since fsck_ffs assumed that
from a conversion from err(3)), so "make it so".
2008-03-16 23:17:55 +00:00
christos 742b48d55e Make sure that the exit values are always sane, and use symbolic instead
of magic constants. Reviewed by go@
2008-02-23 21:41:47 +00:00
ad 2b5d04688e Make it build with src/sys from the vmlocking2 branch. 2007-12-28 21:44:32 +00:00
ad 7dad9f7391 Merge from vmlocking:
- Split vnode::v_flag into three fields, depending on field locking.
- simple_lock -> kmutex in a few places.
- Fix some simple locking problems.
2007-10-10 20:42:20 +00:00
ad fe44973fe3 Give brelse() a second argument so that it matches the kernel.
fsck_lfs now compiles again.
2007-10-08 21:39:49 +00:00
pooka 704e075311 Make all mount(2) return value error checks against -1. Some file
systems just checked != 0, breaking MNT_GETARGS.  Others worked with < 0,
but make them check against -1 too for consistency.  And sprinkle some
stylish line wrapping where appropriate.
2007-07-16 17:06:52 +00:00
dsl 7af7206539 Add additional 'sizeof args' parameter to mount(2). 2007-07-14 15:57:24 +00:00
drochner 628f1591c1 include <signal.h> where signal(3) is used 2007-02-08 21:36:58 +00:00
hubertf df06563bc3 Remove more duplicate #includes,
from Slava Semushin <slava.semushin@gmail.com>
2007-01-17 21:59:49 +00:00
tls e1231b8650 Prompt before rolling forward, in interactive mode, so it's possible to fix
the filesystem but not roll forward possibly unwanted changes.
2006-12-01 06:38:39 +00:00
christos b6479e9fff Fix malloc/realloc/calloc issues: always check and exit, use EEXIT instead
of 8.
2006-11-09 19:36:36 +00:00
christos 8dd4b2bbb0 comment out/delete impossible code 2006-10-16 03:21:34 +00:00
christos 8cf4f4e359 c99 initializers 2006-10-16 03:21:05 +00:00
perseant cb2499ac6e Several fixes to improve the reliability of the roll-forward agent.
Also, note "properly orphaned" files as distinct from corrupted files.
2006-09-01 19:52:48 +00:00
christos 2a1607d040 Programs that use efun. 2006-08-26 18:14:28 +00:00
bjh21 952b42f672 Fix typos in messages: SHOULE -> SHOULD 2006-08-13 22:18:09 +00:00
perseant fabf2934ae On-disk inode accounting fix for roll-forward. 2006-07-19 22:48:11 +00:00
perseant a37f15f04c Don't doubly free an inode remove_ino() during roll-forward. 2006-07-19 02:45:10 +00:00
perseant a0a4c29df0 Quell uninitialized-variable warning that appeared when compiling for macppc. 2006-07-18 23:47:44 +00:00
perseant 29f1062b46 Various improvements to fsck_lfs, to wit:
* Add lfs_balloc capability to the lfs library.
* Extend the Ifile if we run out of free inodes when creating lost+found.
* Don't roll forward if we have allocated a lost+found, to avoid
  conflicts when adding new files in roll-forward.
* Make some messages slightly more verbose (e.g. include inode number,
  and use pwarn() instead of printf() so the messages include the device
  name when preening).
* Change superblock detection/avoidance to use the offset table in the
  primary superblock, rather than looking at the contents.
* Be more verbose about various operations when passed the -d flag,
  especially roll-forward.
* Be more careful about dirops during roll forward, since the cleaner can
  sometimes write blocks from dirop vnodes.  Detect and avoid this problem.
* Always check the free list, even if given -i; if we're going to write
  it we have to check it first.
* Mark inodes dirty when blocks are found during roll forward, so the
  inodes are written with the new block locations.
* Update size of inodes if blocks beyond EOF are found during roll
  forward.
* Fix segment accounting for blocks and inodes found during roll
  forward.
* Report statistics on roll forward: how many new/deleted/moved files
  and how many updated blocks (or "nothing new").
* Don't care if the device being checked is really a device, if we have
  been passed the -f flag (to facilitate automated testing).
* When writing to the disk, use the current time in the segment headers
  rathern than time 0.
* When passed the -i flag, locate the partial segment containing the
  Ifile inode and use that to calculate lfs_offset, lfs_curseg,
  lfs_nextseg.  (Again for automated testing.)
2006-07-18 23:37:13 +00:00
christos 657e8b0071 fsck_lfs does not us fsutil.c; perhaps it should? revert to perror for now. 2006-06-05 23:27:36 +00:00
christos 0268f6ea4e s/perror/perr 2006-06-05 16:53:14 +00:00
jnemeth 13eb323a11 Coverity CID 3447: Add extraneous checks to shut up Coverity. 2006-05-23 22:35:20 +00:00
yamt 69f5e94d4e define dummy NOCRED by ourselves, rather than assuming that kernel headers
provide it.
2006-05-03 15:04:51 +00:00
perseant 00d9f4be09 Avoid a core dump if ginode() returns NULL. Correct an error message
while we're here.
2006-04-28 00:07:54 +00:00
christos 23be85ae7f "struct ucred" should not be exposed to userland. Instead make it a "void *"
since it is not really used.
2006-04-19 15:52:58 +00:00
perseant 7700866e01 Remove the free list ordering/disordering code, since the kernel now keeps
the list in order (ordering it on mount).

Regularize error messages: these are now all in ALL CAPS, with all hex
numbers (not reported in caps) prefixed by 0x.  (The non-fsck-specific
messages are an exception to this all-caps rule.)
2006-04-17 19:05:16 +00:00
perseant 1f429c3724 Don't update the superblock if we were run with -n, regardless of whether
the "clean" bit is set.
2006-04-13 19:50:10 +00:00
christos 0794bfc81d Coverity CID 2551: Don't use LIST_FOREACH() if you are going to free the
current element (bp) in the body of the loop; the foreach does bp = bp->next;
2006-03-20 01:20:55 +00:00
perseant 16cb5d93b2 Make it compile again. 2006-03-17 19:24:08 +00:00
rumble e948e1b17f Check for allocation failures in malloc, calloc, realloc, asprintf, and
vasprintf and try to handle them.
2006-03-17 15:53:46 +00:00
jmc 49c83b8ea2 Put back removed initializer. gcc on sh3 still doesn't get it correct... 2005-10-13 21:14:45 +00:00
chs 6c50e54c82 avoid the need for a bogus initializer. 2005-10-08 03:21:17 +00:00
jmmv 2a3e5eeb7c Apply the NFS exports list rototill patch:
- Remove all NFS related stuff from file system specific code.
- Drop the vfs_checkexp hook and generalize it in the new nfs_check_export
  function, thus removing redundancy from all file systems.
- Move all NFS export-related stuff from kern/vfs_subr.c to the new
  file sys/nfs/nfs_export.c.  The former was becoming large and its code
  is always compiled, regardless of the build options.  Using the latter,
  the code is only compiled in when NFSSERVER is enabled.  While doing this,
  also make some functions in nfs_subs.c conditional to NFSSERVER.
- Add a new command in nfssvc(2), called NFSSVC_SETEXPORTSLIST, that takes a
  path and a set of export entries.  At the moment it can only clear the
  exports list or append entries, one by one, but it is done in a way that
  allows setting the whole set of entries atomically in the future (see the
  comment in mountd_set_exports_list or in doc/TODO).
- Change mountd(8) to use the nfssvc(2) system call instead of mount(2) so
  that it becomes file system agnostic.  In fact, all this whole thing was
  done to remove a 'XXX' block from this utility!
- Change the mount*, newfs and fsck* userland utilities to not deal with NFS
  exports initialization; done internally by the kernel when initializing
  the NFS support for each file system.
- Implement an interface for VFS (called VFS hooks) so that several kernel
  subsystems can run arbitrary code upon receipt of specific VFS events.
  At the moment, this only provides support for unmount and is used to
  destroy NFS exports lists from the file systems being unmounted, though it
  has room for extension.

Thanks go to yamt@, chs@, thorpej@, wrstuden@ and others for their comments
and advice in the development of this patch.
2005-09-23 12:10:31 +00:00
christos 100801ed72 rename lfs.h to lfs_user.h so that it does not conflict. 2005-09-13 04:14:17 +00:00
christos 8a2ba8f0f7 This should be LFS_MAXNAMLEN 2005-08-23 11:44:25 +00:00
tron 0989a73965 Use FFS_MAXNAMLEN instead of MAXNAMLEN. 2005-08-23 11:26:59 +00:00
kent 2fd38e91a5 fix a compilation problem on LP64 2005-08-20 14:59:20 +00:00
christos c4ee9f6d2e 64 bit inode changes 2005-08-19 02:07:18 +00:00
christos 9be35a638f more const. 2005-06-27 02:49:32 +00:00