Commit Graph

27 Commits

Author SHA1 Message Date
christos 23ffdf5bd3 share more code. 2011-06-09 19:57:50 +00:00
bouyer 063f96f3c2 merge the bouyer-quota2 branch. This adds a new on-disk format
to store disk quota usage and limits, integrated with ffs
metadata. Usage is checked by fsck_ffs (no more quotacheck)
and is covered by the WAPBL journal. Enabled with kernel
option QUOTA2 (added where QUOTA was enabled in kernel config files),
turned on with tunefs(8) on a per-filesystem
basis. mount_mfs(8) can also turn quotas on.

See http://mail-index.netbsd.org/tech-kern/2011/02/19/msg010025.html
for details.
2011-03-06 17:08:10 +00:00
bouyer cab6cd67bc Do some basic checks of the WAPBL journal, to abort the boot before the
kernel refuse to mount a filesystem read-write (booting a system
multiuser with critical filesystems read-only is bad):
Add a check_wapbl() which will check some WAPBL values in the superblock,
and try to read the journal via wapbl_replay_start() if there is one.
pfatal() if one of these fail (abort boot if in preen mode,
as "CONTINUE" otherwise). In non-preen mode the bogus journal will
be cleared.
check_wapbl() is always called if the superblock supports WAPBL.
Even if FS_DOWAPBL is not there, there could be flags asking the
kernel to clear or create a log with bogus values which would cause the
kernel refuse to mount the filesystem.
Discussed in
http://mail-index.netbsd.org/tech-kern/2009/08/17/msg005896.html
and followups.
2009-09-13 14:25:28 +00:00
bouyer a8ac39af81 Add fss(4) snapshot support to fsck_ffs(8) (via -x or -X options, like
dump(8)). This allows fsck_ffs -n to work on a snapshot of a R/W mounted
filesystem, and avoid errors related to filesystem activity.
2008-08-30 10:46:16 +00:00
simonb 36d65f1138 Merge the simonb-wapbl branch. From the original branch commit:
Add Wasabi System's WAPBL (Write Ahead Physical Block Logging)
   journaling code.  Originally written by Darrin B. Jewell while
   at Wasabi and updated to -current by Antti Kantee, Andy Doran,
   Greg Oster and Simon Burge.

OK'd by core@, releng@.
2008-07-31 05:38:04 +00:00
christos c236bddb0f sprinkle const. 2005-06-27 01:25:35 +00:00
xtraeme e3c8f73b9a whitespace (pointed out by wiz@) 2005-01-20 15:29:40 +00:00
xtraeme 52781d1897 Kill __P(), ANSIfy and WARNS=2 2005-01-19 17:33:58 +00:00
dbj 753116e06f do not upgrade superblock or set FS_FLAGS_UPDATED unless -c 4 option
is provided.
add compatibility for filesystems before FFSv2 integration
these patches are from pr port-macppc/23925 and should also
fix problems discussed in pr kern/21404 and pr kern/21283
2004-01-09 19:12:31 +00:00
itojun 0e4dc5229d use bounded string op 2003-07-13 08:16:15 +00:00
fvdl 750ed85d47 Write update some old fields when writing the superblock, similar to
ffs_oldfscompat_write() in the kernel. Use the old totals when
time < old_time (i.e. an old kernel or fsck wrote the filesystem last).
When setting the date back on a new kernel, that works out ok, since
new kernels always update both fields.
2003-04-06 17:23:25 +00:00
fvdl 42614ed3f3 Add support for UFS2. UFS2 is an enhanced FFS, adding support for
64 bit block pointers, extended attribute storage, and a few
other things.

This commit does not yet include the code to manipulate the extended
storage (for e.g. ACLs), this will be done later.

Originally written by Kirk McKusick and Network Associates Laboratories for
FreeBSD.
2003-04-02 10:39:19 +00:00
fvdl a3ff3a3038 Bump daddr_t to 64 bits. Replace it with int32_t in all places where
it was used on-disk, so that on-disk formats remain the same.
Remove ufs_daddr_t and ufs_lbn_t for the time being.
2003-01-24 21:55:02 +00:00
lukem bb82a84ded If SIGINFO is received, display summary information to stderr.
Based on changes in FreeBSD, via Chuck Cranor <chuck@research.att.com>
2002-05-06 03:17:43 +00:00
christos 566662ba06 remove redundant declarations 2001-02-04 21:25:54 +00:00
thorpej 9c45d4b02d In pass 5, check alternate superblocks for consistency with
the current in-core master superblock, and fix them up if
they're incorrect.  Move the code that writes the alternate
superblocks if (cvtlevel || doswap) into pass 5 for efficiency.

Reviewd by Charles Hannum, and used by me to fix up a curdled
file system.
2001-01-26 17:37:16 +00:00
mycroft 66418680d4 The reconnect algorithm was historically O(n^4).
Some years ago I made it O(n^2).
Someone helpfully made it O(n^4) again.
Today I'm making it O(n).
If that's not good enough, I don't know what else to do.  B-)

Technical details:
* The graph traversal in propagate() is modified to be able to start from any
  point in the tree.  To handle certain exceptional cases, it is also modified
  to work in two passes, marking the tree with a special tag and then changing
  it to DFOUND.
* The reconnect case now modifies the child/sibling pointers and calls
  propagate() to propagate the connection state starting with the reconnected
  directory.

Pray that you never encounter a file system trashed enough for this to matter.
2001-01-09 05:51:14 +00:00
mycroft 217e6f7a7e const poisoning. 1998-07-26 20:32:42 +00:00
mycroft 2d452ae63c Remove redundant declaration. 1998-07-26 20:28:55 +00:00
bouyer 9aaa32d9a7 Add support for non-native byteorder FFS, and converting byteorder.
Also, be a bit more conservative with the clean flag: don't mark the FS
clean when we know there may still be errors (user anserwed 'n' to
a question, or fsck says "you must rerun fsck").
1998-03-18 17:01:23 +00:00
lukem e111111128 resolve conflicts from lite-2 merge. 1997-09-16 16:44:43 +00:00
christos c5d8ca200f - util.h -> fsutil.h 1996-09-27 22:45:10 +00:00
christos 5528d37484 - fixed all printf formats [there were a lot of %l? <-> %? mistakes]
- added missing prototypes, and made local functions static
- removed parallel preening code; this is part of fsck(8)
- use printing utilities from fsck(8)
- Makefile does not make links to fsck and fsck.8
- removed -l maxparallel option. It has no meaning anymore.
1996-09-23 16:18:31 +00:00
mycroft 7cb70c9889 Set the clean flag if necessary. If preening, don't check `clean' file
systems.
1995-04-12 21:24:07 +00:00
cgd 0114e805ce convert to new RCS Id conventions; reduce my headache 1995-03-18 14:54:19 +00:00
cgd 73cf954189 adjust; from jimj. 1994-12-06 19:13:02 +00:00
cgd 5eeab43e28 more cleanups from Jim Jegers, passed over by me. 1994-12-05 20:15:31 +00:00