Commit Graph

184 Commits

Author SHA1 Message Date
chopps f89312b935 - Fix fallout for recent bread() change (removing cred arg). 2015-03-29 19:35:58 +00:00
dholland b7f1700a57 Revert previous; it doesn't work because all the lfs tools
promiscuously .PATH in each other's source files, and I haven't the
time or patience to deal with it tonight.
2014-07-13 02:44:21 +00:00
dholland ca11835cd5 G/C my_vpanic(). 2014-07-12 19:48:24 +00:00
dholland 6df0042d98 Remove pointless function indirection through panic_func(). It was
initialized to one thing, and then set to another right at the top of
main and never changed again.
2014-07-12 19:44:00 +00:00
dholland 0736ba101a Revert version 1.111 of sysinst/disks.c, which caused sysinst to
create lfs fstab entries with fsck disabled, and instead patch
fsck_lfs to exit successfully without doing anything when given the -p
(bootup preen) option. If you really want to do fsck_lfs -p, you can
do fsck_lfs -f -p to make it go.

This has been sitting in my todo queue since February 2010 and was
ok'd by the committer at the time. The original commit was based on
this post:
   http://mail-index.netbsd.org/tech-kern/2010/02/09/msg007306.html

and I remain unconvinced that it's the right thing, but we can at
least do it properly and not ship a sysinst with -7 that creates
permanently wrong fstab files.

Note that this may cause problems for anyone who's taken -p out of the
bootup fsck flags; but doing that is wrong, so don't.
2014-07-12 16:11:27 +00:00
dholland 9761f1c2dc don't use sprintf 2014-03-23 05:39:32 +00:00
riastradh 6cb10275d0 Merge riastradh-drm2 to HEAD. 2014-03-18 18:20:35 +00:00
christos 3e4993b396 fix unused variable warnings. 2013-10-19 01:09:58 +00:00
wiz a5684d07dd Use Mt for email addresses. 2013-07-20 21:39:55 +00:00
christos 855bb66ef7 Prefix most of the cpp macros with lfs_ and LFS_ to avoid conflicts with ffs.
This was done so that boot blocks that want to compile both FFS and LFS in
the same file work.
2013-06-18 18:18:57 +00:00
dholland 602ba1f79c dp->di_u.inumber -> dp->di_inumber
Should have been part of the previous changeset that applied that
change to lfs.h. I'd quite like to know why the test build I ran
didn't trip on this.
2013-06-08 23:12:13 +00:00
dholland a65dc3fc86 Redo these changes properly:
-r1.12 libexec/lfs_cleanerd/Makefile
 -r1.15 sbin/fsck_lfs/Makefile
 -r1.6 sbin/newfs_lfs/Makefile

hi ad@
2013-06-08 21:13:19 +00:00
dholland c13a12500a Tidy up the LFS userland build hacks.
Don't use -I${NETBSDSRCDIR}/sys; don't include files other than the
exported LFS headers, which are lfs.h, lfs_inode.h, and (for now)
lfs_extern.h.
2013-06-08 02:16:03 +00:00
dholland 25bc01ad43 DIRBLKSIZ -> LFS_DIRBLKSIZ
DIRECTSIZ -> LFS_DIRECTSIZ
DIRSIZ -> LFS_DIRSIZ
OLDDIRFMT -> LFS_OLDDIRFMT
NEWDIRFMT -> LFS_NEWDIRFMT
IFTODT -> LFS_IFTODT
DTTOIF -> LFS_DTTOIF
2013-06-08 02:14:46 +00:00
dholland 4b157546cf struct direct -> struct lfs_direct
struct dirtemplate -> struct lfs_dirtemplate
struct odirtemplate -> struct lfs_odirtemplate
DT_* -> LFS_DT_*
2013-06-08 02:12:56 +00:00
dholland b6eb36b1f1 Stick LFS_ in front of IFMT, IFIFO, IFREG, etc. so as not to conflict
with the UFS copies of these symbols. (Which themselves ought to have
UFS_ stuck on.)
2013-06-08 02:11:11 +00:00
dholland 5fce92dbf7 Move the dinode (on-disk inode) structures to lfs.h, since they are
and will be obviously required by userland tools that need to read
the on-disk structures.

Also, DINODE{1,2}_SIZE -> LFS_DINODE{1,2}_SIZE.
2013-06-08 02:09:35 +00:00
dholland a4fc39c06d Cleanups and hacks to make lfs userland stuff build:
- lfs_cksum.c doesn't actually need ulfs_inode.h any more.
   - neither does lfs_itimes.c.
   - add hacks to fsck_lfs to make it compile.
   - add hacks to newfs_lfs to make it compile.
   - fix warning in ulfs_quota.c when quotas are fully disabled
     (as I guess is happening with the rumpity version)

XXX: This commit adds -I${NETBSDSRCDIR}/sys to the Makefiles for
XXX: fsck_lfs, newfs_lfs, and lfs_cleanerd. This needs to be cleaned
XXX: up ASAP; but I consider this less problematic in the short term
XXX: than spewing ulfs_*.h into /usr/include.
2013-06-06 00:54:49 +00:00
dholland 1ebd9aa225 ufs -> ulfs for fsck_lfs. 2013-06-06 00:52:50 +00:00
dholland dcd34a91c5 Stuff UFS_ in front of a few of ufs's symbols to reduce namespace
pollution. Specifically:
   ROOTINO -> UFS_ROOTINO
   WINO -> UFS_WINO
   NXADDR -> UFS_NXADDR
   NDADDR -> UFS_NDADDR
   NIADDR -> UFS_NIADDR
   MAXSYMLINKLEN -> UFS_MAXSYMLINKLEN
   MAXSYMLINKLEN_UFS[12] -> UFS[12]_MAXSYMLINKLEN (for consistency)

Sort out ext2fs's misuse of NDADDR and NIADDR; fortunately, these have
the same values in ext2fs and ffs.

No functional change intended.
2013-01-22 09:39:11 +00:00
perseant 4ab567960c Correct fragment extension calculation in pass6, to avoid putting
negative block counts on inodes during roll-forward.
2012-01-05 16:18:00 +00:00
bouyer d8593e7a9a PR bin/45299: print FBMASK not FFMASK when lfs_fbmask is incorrect. 2011-08-29 18:43:20 +00:00
dholland 9474f05d3b Don't need to initialize (one of) the elements now in i_crap; nothing in
here touches that material.
2011-07-12 02:46:03 +00:00
mrg 2c77b0841d avoid code that looks like this:
x = x = y;
since GCC 4.5 complains about it having sequence point issues.
2011-06-21 09:36:46 +00:00
christos 23ffdf5bd3 share more code. 2011-06-09 19:57:50 +00:00
mlelstv d3dff438aa dev_bsize wasn't initialized. The actual value doesn't matter since
the same value is used to compute byte offsets into the special file
but a value of zero causes a division by zero.
2010-02-21 16:24:21 +00:00
mlelstv 7974872552 Three changes in a single commit.
- drop the notion of frags (LFS fragments) vs fsb (FFS fragments)
  The code uses a complicated unity function that just makes the
  code difficult to understand.

- support larger sector sizes. Fix disk address computations
  to use DEV_BSIZE in the kernel as required by device drivers
  and to use sector sizes in userland.

- Fix several locking bugs in lfs_bio.c and lfs_subr.c.
2010-02-16 23:20:30 +00:00
christos c68c36a514 Centralize time printing and deal with ctime possibly returning NULL. 2010-02-04 23:55:42 +00:00
christos 808212fb9d missing errno.h 2010-01-07 04:21:28 +00:00
christos 36cd9355e9 make this compile again. 2010-01-07 01:39:56 +00:00
christos 87e82597b6 PR/42568: Pedro F. Giffuni: Better signal handling from OpenBSD, but simplified. 2010-01-06 18:12:37 +00:00
pooka 4be222467f fix prototypes of function pointers to varargs syscalls 2009-10-13 22:04:31 +00:00
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