Commit Graph

363 Commits

Author SHA1 Message Date
fvdl 563d336e44 Don't immediately return in ffs_fsync if there appears to be no data
to flush if it's a vnode on a softdep filesystem. softdep_sync_metadata
may still need to do some work.
2000-03-14 13:06:29 +00:00
soren 95054da1a1 Fix doubled 'the's in comments. 2000-03-13 23:52:25 +00:00
bouyer 31a775880b lfs_truncate: handle synlinks with length > maxsymlink_len as regular files.
For symlinks > 60 chars we were bzero'ing part of (struct inode) past the
actual inode struct, corrupting memory following the current (struct inode)
resuling in a 'panic: pool_get(lfsinopl): free list modified' later.
This could also be the cause of random panics. With this fix LFS seems to be
useable for me now.
2000-03-12 01:45:01 +00:00
perseant 61fa9e1409 Move vinvalbuf's check for dirty blocks into ffs_fsync, to ensure that
mode and ownership bits are flushed to disk before the vnode is
reclaimed.

The check, introduced in the softdep merge, assumes that if no blocks
are dirty, no file data *or metadata* needs to be flushed to disk.  This
is true of ffs, but is not true of lfs, and may not be true of other
filesystems.

Tested by myself and Bill Squier <groo@cs.stevens-tech.edu>.
2000-03-11 05:00:18 +00:00
fvdl 89670eb646 Fix a bug introduced in Lite2 with block allocation and full disk
conditions. Reported by Ian Dowse <iedowse@maths.tcd.ie>, based
on patch in FreeBSD reviewed by Kirk McKusick.
2000-02-25 19:58:25 +00:00
wiz 1515bd47fc remove obsoleted #if defined(UVM) 2000-02-20 06:34:46 +00:00
fvdl fe39281ea4 Fixes to the softdep code from Ethan Solomita <ethan@geocast.com>.
* Fix buffer ordering when it has dependencies.
* Alleviate memory problems.
* Deal with some recursive vnode locks (sigh).
* Fix other bugs.
2000-02-14 22:00:21 +00:00
bouyer 425e99ac00 Check that we can handle the inode size before mounting the fs, and correct
a return value.
2000-01-31 11:34:55 +00:00
bouyer be4a409b30 Correct (minor) bogons in filetype option support, and add support
for sparse_super option
2000-01-28 16:00:23 +00:00
bouyer 5fb6bc4e18 First cut at ext2fs rev 1 support (as of mke2fs 1.18): supports the filetype
option read/write and the sparse option read-only.
2000-01-26 16:21:31 +00:00
thorpej 0b0aecffd6 Update for sys/buf.h/disksort_*() changes. 2000-01-21 23:43:10 +00:00
perseant dac789be22 Changes to stabilize LFS. The first two of these should also apply to the
1.4 branch.

* Use a separate per-fs lock, instead of ufs_hashlock, to protect the Inode
  free list.  This seems to prevent the "lockmgr: %d, not exclusive lock holder
  %d, unlocking" message I was mis-attributing last night to an unlocked vnode
  being passed to vrele.

* Change calling semantics of lfs_ifind, to give better error reporting:
  If fed a struct buf, it can report the block number of the offending inode
  block as well as the inode number.

* Back out rev 1.10 of lfs_subr.c, since the replacement code was slightly
  uglier while being functionally identical.

* Make lfs_vunref use the same free list convention as vrele/vput, so that
  vget does not remove vnodes from a hash list they are not on.
2000-01-19 00:03:04 +00:00
bouyer 3c680c00ab Handle pre-FS_42POSTBLFMT. I now can mount an Ultrix file system on my
sparc without panic.
2000-01-18 18:41:29 +00:00
perseant bfde45e89f Make sure that vnodes are locked when inactivated (e.g. by the cleaner) 2000-01-16 09:15:51 +00:00
perseant 86b0e2dc16 Fix a problem in my changes of Dec 14th, that prevents removed vnodes
from being inactivated under some conditions.  Removed vnodes are now
inactivated when the VDIROP flag is cleared, and to prevent block
accounting problems this clearing has been postponed until
lfs_segunlock.
2000-01-16 05:56:14 +00:00
perseant a38b519087 correct typo (reference uninitialized variable) 2000-01-16 04:57:08 +00:00
perseant 1b67daa4b4 Expand the category of "metadata" in lfs_markv to include Ifile data blocks.
This prevents a rare condition in which Ifile "ifile" blocks, that is, the
blocks of the ifile which point VOP_VGET at the inode block containing the
requested inode, from being "unwritten" when cleaning during intense disk
activity.
2000-01-14 21:41:11 +00:00
perseant dbe30ed5d4 Better handling of various combinations of cleaning, vnode flushing, and
dirop writing.  In particular, lfs_writevnodes now writes all buffers from
a flushed vnode whether cleaning or not, and the same with the Ifile; and
lfs_segwrite does not attempt to write data from other non-cleaning vnodes,
even if a vnode is being flushed.
2000-01-14 21:38:46 +00:00
perseant 32bd59cdf6 Fix error returns on lfs vnops so that locks and reference counts are
preserved.  Handle dirop accounting in lfs_vfree for this case as well.
May address PR#8823.
1999-12-15 07:19:07 +00:00
perseant fa6a733240 In lfs_bwrite, don't mark buffers dirty if lfs is mounted read-only.
(Previously buffers could be marked dirty by the cleaner, and possibly by
other means.)

Also check for softdep mount in vfs_shutdown before trying to bawrite
buffers, since other filesystems don't need it and lfs doesn't bawrite.
(This fragment reviewed by fvdl.)

Partially addresses PR#8964.
1999-12-15 07:10:32 +00:00
wrstuden b93040c6f1 Modify ufs_rename() to a) be more careful about reference counts (we no longer
depend on the initial lookups being doen with SAVESTART), and b) check
return values for errors.

Should fix PR 8491 for ufs - two simultaneous identical renames will now
work correctly. One will succeed, one will fail.
1999-12-13 19:07:21 +00:00
drochner 800b976584 Call ffs_oldfscompat() before all the consistency checks, to avoid the
use of uninitialized data in the checks if the filesystem is an old one.
1999-12-10 14:36:04 +00:00
simonb 3238e654f9 Use an explicitly sized type (u_int32_t) for inode numbers in the super
block instead of ino_t.  Reviewed by Konrad Schroder.
1999-12-08 23:17:31 +00:00
ragge 6aabd4d0c2 CL* discarding. 1999-12-04 12:11:13 +00:00
perseant 22979769c0 Handle the case of a vnode flush while dirops are active correctly in
lfs_segwrite.  Also, make sure a flush is called in SET_DIROP before sleeping
on its results.  Addresses PR #8863.
1999-12-03 21:47:44 +00:00
fvdl d901f6eae0 Be more careful to block bio interrupts for some data structures. There
were at least a few missed cases where vp->v_{clean,dirty}blkhd were
unprotected since the softdep/trickle sync merge.
1999-11-23 23:52:40 +00:00
perseant bb2093f24a Initialize i_ffs_effnlink, so every file doesn't look like it's already been
deleted for the purpose of dirops (particularly create and mkdir).  Addresses
PR#8815.
1999-11-21 19:25:31 +00:00
enami 13cd632041 Define i_e2fs_rdev. 1999-11-18 08:26:21 +00:00
enami 068ded93c6 Cosmetic changes; fix indentation and usage of white spaces. 1999-11-18 08:23:22 +00:00
perseant ff33b3365d Fix spllevel problem with superblock exclusion and with segment write throttle.
May address PR#8383.
1999-11-17 20:08:30 +00:00
lukem a3b9423bb0 fix lp64 lossage 1999-11-16 03:06:06 +00:00
fvdl 0b1963121a Add Kirk McKusick's soft updates code to the trunk. Not enabled by
default, as the copyright on the main file (ffs_softdep.c) is such
that is has been put into gnusrc. options SOFTDEP will pull this
in. This code also contains the trickle syncer.

Bump version number to 1.4O
1999-11-15 18:49:07 +00:00
perseant fc5ecbb5a8 Back out my patch of the 8th (to address unreferenced inode problem).
Apparently this needs more thought.
1999-11-12 16:56:48 +00:00
perseant 26c34e715f If ifile blocks were written before dirops were complete, and then the
system crashed, inodes could be allocated that were not referenced.  (Though
not a serious problem, it evidences itself in phase 4 of fsck_lfs.)  Fix
this by marking if_daddr with UNASSIGNED before the inodes are actually
written; at mount time the ifile is checked for UNASSIGNED entries and
any that are found are linked back into the free list.  (The latter
functionality should move into the roll-forward agent when it materializes.)
1999-11-09 02:21:05 +00:00
perseant 3c63d0830f Address ufs_hashlock/ufs_ihashins protocol bug, discovered while doing a
post-mortem of a production machine.  Also, take the active dirop
count off of the fs and make it global (since it is measuring a global
resource) and tie the threshold value LFS_MAXDIROP to desiredvnodes.
1999-11-06 20:33:05 +00:00
perseant b46550bdcf Better fix for PR# 8577: before setting dirops, check for cross-device
rename and error out.  This avoids possible problems with attempting
rename between two LFSs.
1999-11-05 20:14:56 +00:00
perseant ea1f38ce2f Check that the destination vnode is on an LFS before trying to twiddle
its superblock.  Fixes PR#8577.
1999-11-01 18:29:33 +00:00
perseant fde29faf34 Under degenerate access patterns (e.g. `bonnie' benchmark) lfs_check could
fail, because the particular block being requested was always in the cache
(although other routines that cannot afford to call lfs_check have in the
meantime stuffed the cache full of dirty blocks).  Partially addresses PR 8383.
1999-10-21 16:53:43 +00:00
enami fee96e1746 Check if the type of device node isn't VBAD before touching v_specinfo. If
the device vnode is revoked, the field is NULL and touching it causes null
pointer derefercence.
1999-10-20 14:32:09 +00:00
wrstuden e5bf8dc4d5 Catch a few cases missed earlier where we need to lock the vnode before
calling VOP_CLOSE().
1999-10-18 19:52:24 +00:00
wrstuden e682a080e9 In spec_close(), if we're not doing a non-blocking close and VXLOCK is
not set, unlock the vnode before calling the device's close routine and
relock it after it returns. tty close routines will sleep waiting for
buffers to drain, which won't happen often times as the other side needs
to grab the vnode lock first.

Make all unmount routines lock the device vnode before calling VOP_CLOSE().
1999-10-16 23:53:26 +00:00
mycroft 02781a3483 Fix printf() formats. 1999-10-01 22:07:42 +00:00
thorpej 29df848753 Need <string.h> for memcpy(3) prototype if building from userland. 1999-09-14 04:50:54 +00:00
augustss ada52e1f37 Add #include <sys/device.h> so this file compiles again. 1999-09-08 08:29:45 +00:00
sommerfeld c0411740d8 Avoid dereferencing NULL rootvp if booting diskless. 1999-09-08 03:45:22 +00:00
jdolecek 7dfaa17700 Adapt to cache_lookup() changes.
Tested by: jdolecek
Rewieved by: wrstuden
1999-09-05 14:26:32 +00:00
perseant c588aaf55f Make changes that will allow an LFS filesystem to be used as the root
filesystem.  In particular,

- Fix mknod deadlock, described in PR 8172.
- Enable lfs_mountroot.
- Make lfs_writevnodes treat filesystems mounted on lfs device nodes properly,
  by flushing that device rather than trying to add blocks to the device inode.

This, in combination with lfs boot blocks, will allow operation of an all-lfs
system.
1999-09-03 22:48:51 +00:00
wrstuden 169a5eda2d Pull in changes which parallel rev 1.22 -> 1.25 of ufs_lookup(). 1999-08-04 18:40:47 +00:00
wrstuden 45ce38544f Make the compiler happy.. 1999-08-04 18:40:06 +00:00
wrstuden 3598f580dc Fix tyop in previous. 1999-08-04 18:14:59 +00:00