Commit Graph

1716 Commits

Author SHA1 Message Date
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
bouyer aa0e1a2ecf vclean() actually sets v_tag to VT_NON but doesn't touch v_type.
getcleanvnode() sets v_type to VNON after releasing v_interlock.
So the thread doing quotaon(), quotaoff() or qsync() could vget()
a vnode which is being recycled in getcleanvnode(), after is has
been cleaned and v_interlock released, but before v_type has been
reset, leading to KASSERT(vp->v_usecount == 1) firing in
getnewvnode(), or qsync() dereferending a NULL pointer as in
PR kern/42205.
Fix by using the same tests as other ffs function traversing the mount
list: also check for VTOI(vp) == NULL, and VI_XLOCK in addition
to VI_CLEAN.
2010-01-15 19:46:35 +00:00
pooka c3183f3251 The VATTR_NULL/VREF/VHOLD/HOLDRELE() macros lost their will to live
years ago when the kernel was modified to not alter ABI based on
DIAGNOSTIC, and now just call the respective function interfaces
(in lowercase).  Plenty of mix'n match upper/lowercase has creeped
into the tree since then.  Nuke the macros and convert all callsites
to lowercase.

no functional change
2010-01-08 11:35:07 +00:00
eeh 9d21c97885 Fix some more hangs and deadlocks. 2009-12-07 04:12:10 +00:00
tsutsui 5517f8a4c3 Add definitions for more reserved inodes. 2009-11-27 11:16:54 +00:00
yamt a646187eba use NULL instead of 0 for pointers 2009-11-18 12:22:48 +00:00
eeh bfd5cc9df2 This should fix a deadlock. 2009-11-17 22:49:24 +00:00
pooka 8454e30192 Create unwind log in global variable instead of automatic variable.
memory leak spotted by njoly's valgrind run
2009-11-17 17:08:57 +00:00
pooka 2e098f1f4e ... actually, define compat only for the kernel. Userlandia should
see only one version of the interfaces.
2009-11-05 17:16:36 +00:00
pooka 5207b24e34 Include compat/sys/time_types.h instead of compat/sys/time.h.
Fixes lint drama with interface name collisions.
2009-11-05 16:59:55 +00:00
pooka c584ccaa0d Include compat code by default. 2009-11-05 11:54:49 +00:00
bouyer 6b8161200e getcleanvnode(): don't vclean() the vnode if it has gained another
reference while we were getting the v_interlock.
vget(): attempt prevent it from returning a clean vnode:
  if the vnode is being inactivated (by vrelel()), wait for
  vrelel() to complete (or return EBUSY if we can't wait), and return
  ENOENT if the vnode has been vclean'ed by vrelel()
Fix kern/41147 in a better way, hopefully fix other related race conditions.
2009-11-05 08:18:02 +00:00
hannken d35df7da38 Now that softdep has left the tree the only place needing the ffs_lock()
hack is ffs_sync().

- Use the generic lock operations for ffs.
- Change ffs_sync() to omit the vnode lock while suspending.

Reviewed by: Antti Kantee <pooka@netbsd.org>
2009-11-04 09:45:05 +00:00
christos 2ef9c80a16 compile without COMPAT_50 2009-10-30 00:53:29 +00:00
eeh f50f807334 Fix up numoutput accounting. 2009-10-29 18:20:11 +00:00
christos fc0e85c95e PR/42246: NAKAJIMA Yoshihiro: provide COMPAT_50 for LFS 2009-10-29 17:10:32 +00:00
pooka 447898cbb0 update i_uid and i_gid after chown 2009-10-21 17:37:21 +00:00
bouyer 6d07b400dc Remove closes 3 & 4 from my licence. Lots of thanks to Soren Jacobsen
for the booring work !
2009-10-19 18:41:07 +00:00
hannken 4e246abd4c No longer abuse TAILQ internal data. 2009-10-15 10:05:48 +00:00
hannken df5d842a2c ufs_rmdir(): move fstrans_done() after vput(). No more unlinked and
zero-sized directory inodes in snapshots.
2009-10-14 09:40:27 +00:00
hannken 8deb3262b5 Fix a deadlock where fscow_disestablish() blocks because outstanding
copy-on-write operations wait for si_snaplock.
2009-10-13 12:38:14 +00:00
rmind ae2795775d ufsdirhash_recycle(): modify ufs_dirhashmem atomically. 2009-10-05 23:48:08 +00:00
dholland 6f7fa47c46 Avoid nasal demons. Code of the form
vput(vp);
   error = VFS_VGET(vp->v_mount, ...);

just isn't right. Because of vnode caching this *probably* never bit
anyone, except maybe under very heavy load, but still.
2009-09-28 00:39:03 +00:00