Commit Graph

1738 Commits

Author SHA1 Message Date
mlelstv 6c899f7536 For update mounts the root vnode is already in use and we must not
free it. Since the mount persists even when the update fails,
this is not a problem either.
2010-12-24 13:38:57 +00:00
mlelstv 5eee906941 mount(2) doesn't remove vnodes from the freelist in the error path,
so that they get reused with a invalid pointer to a mount structure.

As a workaround, free the vnodes used to create the in-filesystem journal
immediately.
2010-12-23 14:43:37 +00:00
matt 6a66466f0c Move counting of faults, traps, intrs, soft[intr]s, syscalls, and nswtch
from uvmexp to per-cpu cpu_data and move them to 64bits.  Remove unneeded
includes of <uvm/uvm_extern.h> and/or <uvm/uvm.h>.
2010-12-20 00:25:23 +00:00
eeh 3c8b71849f Byebye deadlock. 2010-12-18 00:01:46 +00:00
hannken 3b57b82b8f Keep a reference to the snapshot vnode until it gets removed from the
snapshot list.
2010-12-12 10:29:25 +00:00
hannken f29d5492f8 syncsnap: Use bbusy() to take a buffer from v_dirtyblkhd. 2010-12-12 10:28:22 +00:00
dholland 14402d0ff1 Abolish the SAVENAME and HASBUF flags. There is now always a buffer,
so the path in a struct componentname is now always valid during VOP
calls.
2010-11-30 10:43:01 +00:00
dholland d4eb05390d Abolish struct componentname's cn_pnbuf. Use the path buffer in the
pathbuf object passed to namei as work space instead. (For now a pnbuf
pointer appears in struct nameidata, to support certain unclean things
that haven't been fixed yet, but it will be going away in the future.)

This removes the need for the SAVENAME and HASBUF namei flags.
2010-11-30 10:29:57 +00:00
dholland 8f6ed30d57 Introduce struct pathbuf. This is an abstraction to hold a pathname
and the metadata required to interpret it. Callers of namei must now
create a pathbuf and pass it to NDINIT (instead of a string and a
uio_seg), then destroy the pathbuf after the namei session is
complete.

Update all namei call sites accordingly. Add a pathbuf(9) man page and
update namei(9).

The pathbuf interface also now appears in a couple of related
additional places that were passing string/uio_seg pairs that were
later fed into NDINIT. Update other call sites accordingly.
2010-11-19 06:44:33 +00:00
chs fca58884f4 replace the earlier workaround for PR 40389 with a better fix.
the earlier change caused data corruption by freeing pages
without invaliding their mappings.  instead of the trylock/retry,
just take the genfs-node lock before calling VOP_GETPAGES()
and pass a new flag to tell it that we're already holding this lock.
2010-09-01 16:56:19 +00:00
hannken 559469276d ffs_reclaim: don't free an already free inode. This may happen when
ffs_fhtovp() gets a free inode and releases it.
2010-08-12 07:41:49 +00:00
pooka 6e5ca1ed9e add a linefeed to the previous 2010-08-09 17:12:18 +00:00
pooka 5140c8efdf Return error if we try to mount a file system with block size > MAXBSIZE.
Note: there is a billion ways to make the kernel panic by trying
to mount a garbage file system and I don't imagine we'll ever get
close to fixing even half of them.  However, for this one failing
gracefully is a bonus since Xen DomU only does 32k MAXBSIZE and
the 64k MAXBSIZE file systems are out there (PR port-xen/43727).

Tested by compiling sys/rump with CPPFLAGS+=-DMAXPHYS=32768 (all
tests in tests/fs still pass).  I don't know how we're going to
translate this into an easy regression test, though.  Maybe with
a hacked newfs?
2010-08-09 15:50:13 +00:00
hannken bb874d13b8 Free the on disk inodes in the reclaim routine. 2010-08-04 10:43:53 +00:00
hannken c84e81cad1 Add vm page flag PG_MARKER and use it to tag dummy marker pages
in genfs_do_putpages() and uao_put().
Use 'v_uobj.uo_npages' to check for an empty memq.
Put some assertions where these marker pages may not appear.

Ok: YAMAMOTO Takashi <yamt@netbsd.org>
2010-07-29 10:54:50 +00:00
hannken 3a7edffde9 ext2fs,ffs: free on disk inodes in the reclaim routine.
Remove now unneeded vnode flag VI_FREEING.

Welcome to 5.99.38.

Ok: Andrew Doran <ad@netbsd.org>
2010-07-28 11:03:47 +00:00
jakllsch a9e9b32ddd Make DEBUG_EXT2 work with 64-bit size_t. 2010-07-27 05:15:56 +00:00
hannken fb62bef947 Make holding v_interlock mandatory for callers of vget().
Announced some time ago on tech-kern.
2010-07-21 17:52:09 +00:00
hannken 245651a23d Remove vlockmgr(). Generic vnode lock operations now use a rwlock located
in the vnode.  All LK_* flags move from sys/lock.h to sys/vnode.h.  Calls
to vlockmgr() in file systems get replaced with VOP_LOCK() or VOP_UNLOCK().

Welcome to 5.99.34.

Discussed on tech-kern.
2010-07-01 13:00:54 +00:00
hannken 07c29bfbcb Undo last commit and don't try to lock vnodes in lfs_unmark_dirop()
as we may deadlock trying to write the superblock.

Should fix PR #43503 Can't create device nodes on LFS.
2010-06-25 10:03:52 +00:00
hannken 1423e65b26 Clean up vnode lock operations pass 2:
VOP_UNLOCK(vp, flags) -> VOP_UNLOCK(vp): Remove the unneeded flags argument.

Welcome to 5.99.32.

Discussed on tech-kern.
2010-06-24 12:58:48 +00:00
hannken f6c438ba23 Clean up vnode lock operations:
- VOP_LOCK(vp, flags): Limit the set of allowed flags to LK_EXCLUSIVE,
   LK_SHARED and LK_NOWAIT.  LK_INTERLOCK is no longer allowed as it
   makes no sense here.

- VOP_ISLOCKED(vp): Remove the for some time unused return value
  LK_EXCLOTHER.  Mark this operation as "diagnostic only".
  Making a lock decision based on this operation is no longer allowed.

Discussed on tech-kern.
2010-06-24 07:54:46 +00:00
hannken 67c30e0802 Initialize the initial snap block list's count.
From Antti Kantee <pooka@netbsd.org>.
2010-06-02 09:56:59 +00:00
pooka 5e918e3804 Add a comment describing an observed boom-crash-burn problem in
the code.  Fixing it will require a full tank of gas, half a pack
of cigarettes, sunglasses, darkness, and most importantly:
someone else.
2010-05-25 11:02:07 +00:00
dbj 1da7b01e3b switch from 4 clause to 2 clause BSD license. 2010-04-24 19:58:13 +00:00
pooka 0c20c076ce Enforce RLIMIT_FSIZE before VOP_WRITE. This adds support to file
system drivers where it was missing from and fixes one buggy
implementation.  The arguably weird semantics of the check are
maintained (v_size vs. va_bytes, overwrite).
2010-04-23 15:38:46 +00:00
hannken bceb3e2b5b Add fstrans transactions to ufs_close(), ufs_getattr(), ufs_chmod()
and ufs_chown().  These functions change file system state.
2010-04-13 09:27:58 +00:00
pooka 242bf1c3e7 Stop exposing fifofs internals and leave only fifo_vnodeop_p visible. 2010-03-29 13:11:32 +00:00
hannken afab4c313c Allow ufs_inactive() while a file system is suspending. Removes a possible
deadlock between vrele() and ffs_sync() during suspension.
2010-03-15 09:20:10 +00:00
pooka d1d083d372 fs_lfs.h is no longer necessary 2010-03-02 19:59:09 +00:00
pooka 5de34505ef load lfs syscalls in modload 2010-03-02 19:34:49 +00:00
pooka 96798ffe71 /*
* XXX: Get extra reference to LFS vfsops.  This prevents unload,
 * but also prevents kernel panic due to text being unloaded
 * from below lfs_writerd.  When lfs_writerd can exit, remove
 * this!!!
 */
2010-03-02 19:30:34 +00:00
pooka 1a66ba1950 Remove fs_mfs.h from users because it is now unnecessary and don't
generate fs_mfs.h anymore.
2010-03-02 17:28:08 +00:00
pooka d6f18673d1 Make mfs_initminiroot() mandatory. Allows to remove #ifdef MFS. 2010-03-02 17:20:02 +00:00
pooka 4f49fb9915 Don't generate unused fs_thefs.h headers. 2010-03-02 16:43:48 +00:00
pooka 2e6110dc37 Remove last #ifdef FFS. Do this by making lfs include ffs.
Could use UFS_OPS, but:

  1) the lfs kernel module depends on full ffs already anway
  2) lfs is being split from ufs, so this will automatically
     go away soon
  3) chances of anyone wanting an lfs-only kernel are pretty slim
  4) i'm too lazy to figure out how to test ffs_snapgone() is
     still called properly if I change the call ;)
2010-03-02 15:18:22 +00:00
pooka 2dfc1bdbed scortch ufs_vnops.c cargo cult headers 2010-03-02 14:45:55 +00:00
mlelstv ef95b640b0 Store physical block numbers in superblock that point to the journal.
Calculate position of both commit headers correctly for disks with
large sectors.
Correct calculation of circular buffer size.
2010-02-27 12:04:19 +00:00
mlelstv 6d6d11f709 Replace individual queries for partition information with
new helper function.
Use this information to query physical sector sizes for WAPBL
instead of hardcoded defaults.
No longer limits physical sector sizes to 512 bytes.
2010-02-23 20:41:41 +00:00
mlelstv 03c7f48412 For the UVM_PAGE_TRKOWN test do not require that the relevant pages
must exist.
2010-02-21 13:55:58 +00:00
eeh 836736c39d Fix root filesystem support. 2010-02-18 01:14:00 +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
mlelstv b10f49caa8 There is no code left that uses disk size data, so don't query it. 2010-02-11 19:50:34 +00:00
mlelstv b44bbb30f5 There is no code left that uses disk size data, so don't query it.
This also failed when querying the simulated block device from mfs.
Fixes PR kern/42782.
2010-02-11 00:06:16 +00:00
bouyer be891954ad - ufs_balloc_range(): on error, only PG_RELEASED the pages that were
allocated to extend the file to the new size. Releasing all pages
  may release pages that contains previously-written data not yet flushed
  to disk. Should fix PR kern/35704
- {ffs,lfs,ext2fs}_truncate(): Even if the inode's size is the same as
  the new length, call uvm_vnp_setsize(). *_truncate() may have been
  called by *_write() in the error path (e.g. block allocation failure
  because of quota of file system full), and at this point v_writesize
  has been set to the desired size of the file and not reverted to the
  old size. Not adjusting v_writesize to the real size cause
  genfs_do_io() to write to disk past the real end of the file.
2010-02-07 17:12:40 +00:00
mlelstv bb2d547d2f Correct addressing of superblock updates. 2010-02-05 20:03:36 +00:00
mlelstv 748a0d77b1 Fix block shift to work with different device block sizes.
Unlike other filesystems this has some side issues because
the shift values are stored in the superblock and because
userland utitlies share the same fsbtodb macros.

-> the kernel now ignores the value stored in the superblock.
-> the macro adaption is only done for defined(_KERNEL) code.
2010-01-31 10:54:10 +00:00
mlelstv 5e340cd634 Replace individual queries for partition information with
new helper function.
2010-01-31 10:50:23 +00:00
mlelstv 928ded5f56 Fix block shift to work with different device block sizes. 2010-01-31 10:37:57 +00:00
mlelstv ba0d32752c Replace individual queries for partition information with
new helper function.
2010-01-31 10:30:40 +00:00