Commit Graph

1606 Commits

Author SHA1 Message Date
pooka bbaefad73d Break hold-and-wait which happens in ufs_balloc_range() when we
have pages busied and are trying to get the genfs node lock.
This causes a lock order reversal described in PR kern/40389.
This is not a proper fix and only a workaround for NetBSD 5.0.

problem first reported by simonb, patch tested by rmind
2009-02-04 21:07:19 +00:00
ad 74d10dbea4 PR kern/40469 5.0_BETA/amd64 INSTALL kernel panics when installing on log-enabled filesystems
PR kern/40470 WAPBL corrupts ext2fs

Don't touch inodes at all unless VOP_FSYNC(). Might fix the ext2fs problem,
I am not sure.
2009-02-01 17:36:43 +00:00
yamt 18be80bfbe 0 -> NULL 2009-01-31 09:22:08 +00:00
yamt e52a72295f wapbl_log_position: 1 -> MNT_WAIT 2009-01-31 09:14:15 +00:00
lukem c5eb4ab601 fix -Wsign-compare issues 2009-01-18 11:56:51 +00:00
yamt 4f322c072e one more change which i forgot to commit with
UVM_PAGE_HASH_PENALTY -> UVM_PAGE_TREE_PENALTY rename.
noticed by Andreas Wrede.
2009-01-16 05:15:29 +00:00
pooka a5ae82a57e Revert 1.101, author did not provide a justification. 2009-01-15 21:26:03 +00:00
yamt 70de973662 g/c BUFQ_FOO() macros and use bufq_foo() directly. 2009-01-13 13:33:58 +00:00
christos 461a86f9bd merge christos-time_t 2009-01-11 02:45:45 +00:00
hannken fc6d5c7578 Remove superfluous "vp->v_vnlock = &vp->v_lock".
Observed by: YAMAMOTO Takashi <yamt@netbsd.org>
2009-01-03 15:29:08 +00:00
christos 437cf02e63 Don't try to ffs_update VT_NON vnodes 2008-12-28 16:27:00 +00:00
cegger f1b926ed8b ffs_update: sprinkle KASSERTs 2008-12-23 11:32:08 +00:00
ad f1ec31c6b1 Add a comment. 2008-12-22 12:18:48 +00:00
ad 0472423773 PR kern/40246 current panics when removing swap devices
Someone was smoking crack when they decided to unconditionally OR FSYNC_VFS
into the flags for block devices.
2008-12-22 11:46:33 +00:00
ad c63481baaa Print a warning message and return EOPNOTSUPP if the user tries to enable
quotas on a file system that is using logging.
2008-12-21 10:48:10 +00:00
ad 83f7350f6d PR kern/40210 5.0 BETA WAPBL related crash 2008-12-21 10:44:32 +00:00
pgoyette 9c68331911 Store config(1)'s root filesystem type as a text string rather than
embedding the address of its xxx_mountroot() in swapnetbsd.c.  This
permits booting of kernels with hard-wired filesystem type even if the
filesystem is in a loadable module (ie, not linked into the kernel
image).

Discussed on current-users.  Tested on amd64 and i386 with both hard-
wired and '?' filesystem times, and on both modular and monolithic
kernels.

Thanks to pooka@ for code review and suggestions.

Addresses my PR kern/40167
2008-12-19 17:11:57 +00:00
hannken e1e7ee242d Restore a line removed by mistake with the last commit.
Should fix PR 40225 panic: indiracct: missing indir.
2008-12-19 11:36:10 +00:00
cegger 9b87d582bd kill MALLOC and FREE macros. 2008-12-17 20:51:31 +00:00
dholland 2adcd1a3c2 Don't deadlock on rename("foo/foo", "foo") in the case where foo/foo is a
directory. This doesn't affect non-wapbl renames; it affects wapbl because
one of the lock acquisitions was moved up past where this case otherwise
fails.

PR 40163 from Lloyd Parkes.
2008-12-13 04:45:28 +00:00
pooka d34f27b620 Decode write access advice and pass to uvm (not that it's handled
there, but ...).
2008-12-08 11:48:03 +00:00
pooka 5297d2febf Don't even try to pretend WAPBL_DEBUG_INODES works here, just #error. 2008-12-08 11:37:37 +00:00
pooka 836c2144d0 Remove no longer valid comment (which probably didn't even say what
it wanted to say in the first place).
2008-12-08 11:34:30 +00:00
hannken 59f928fb25 ffs_copyonwrite(): Only use si_snapblklist if it is already allocated.
ffs_snapshot_read(): Use IO_ALTSEMANTICS to allow reading a snapshot vnode
                     beyond file system size.  Needed to read the snapblklist
                     on mount.

Persistent snapshots work again.

Should fix PR kern/37425: fss_snapshot_mount panic during fsck.
2008-12-07 19:51:07 +00:00
hannken 8e313cc27b Revert previous -- ALL reads are from kernel space.
Still open: PR kern/37425: fss_snapshot_mount panic during fsck.
2008-12-07 18:55:58 +00:00
hannken 7dbaf06e71 ffs_copyonwrite(): Only use si_snapblklist if it is already allocated.
ffs_snapshot_read(): Allow the kernel to read beyond file system size.

Persistent snapshots work again.

Should fix PR kern/37425: fss_snapshot_mount panic during fsck.
2008-12-07 10:01:09 +00:00
joerg 9a364d2ed3 Split ffs_freefile into a frontend for normal cylinder group and for
snapshot use. Adjust ffs_blkfree_common to get the fs instance passed
in, the original commit didn't account blocks in the snapshots
correctly. Assert that ffs_blkfree is used with the primary fs instance
and that ffs_checkfreefile is only used for snapshots. Move the bdwrite
from ffs_blkfree_common into the caller for symmetry. This creates a
redundant write of unmodified data for ffs_blkfree_snap if a double free
of a block happens.

Reviewed and tested by hannken@.
2008-12-06 20:05:55 +00:00
joerg 6cdfaeec55 Revert last. Conditionalize variables on FFS_EI. 2008-12-01 13:45:51 +00:00
cegger 9c45aac9d8 build fix: remove unused variables 2008-12-01 13:33:39 +00:00
joerg 740a2c079c ffs_blkfree is used in two different ways. The normal usage is to free a
block in the cylinder groups of the filesystem. The other user is the
snapshot code, which wants to modify the copied cylinder groups. Use
different frontends to distinguish the cases in preparation for fine
grained locking for cylinder groups.
2008-12-01 13:22:06 +00:00
joerg dfd7714b8f Split ffs_blkalloc into a frontend that does inode based consistency
checks and a backend that just asserts them. Use the backend in
ffs_wapbl_abort_sync_metadata instead of faking an inode.
2008-11-30 16:20:44 +00:00
pooka b4099c3e1d Rototill all remaining file systems to use ubc_uiomove() instead
of the ubc_alloc() - uiomove() - ubc_release() dance.
2008-11-26 20:17:33 +00:00
tsutsui 24ec9f1685 Remove an extra semicolon. 2008-11-24 17:11:43 +00:00
mrg ef028d2043 add support for 32 bit uid/gid fields in ext2, but only do so for
when the revision is > REV0.
2008-11-23 10:09:25 +00:00
ad 2f839a2253 These depend on ffs. 2008-11-13 11:10:41 +00:00
ad bed0008a9a Remove #ifdef LFS from the ufs code. 2008-11-13 11:09:45 +00:00
ad d7360a07e4 _KERNEL_OPT 2008-11-13 10:48:52 +00:00
ad 669263e5c2 _KERNEL_OPT 2008-11-13 10:14:55 +00:00
joerg e09eb39f96 wapbl_replay_free needs the reply to have been stopped, so make sure
that the changes happen in the right order. Reported by veego@
2008-11-11 21:02:54 +00:00
joerg b9400f6fd4 Move WAPL replay handling from bread() into ufs_strategy.
This changes the order of hook processing as the copy-on-write handlers
are called after the journal processing. This makes more sense as the
journal overwrite is logically part of the disk IO.
2008-11-11 08:29:58 +00:00
joerg 3fbdfc8af9 Reduce internals of WAPBL exposed to the rest of the system. 2008-11-10 20:12:13 +00:00
joerg ecbfc2933c Remove XXXUBC code for ffs_reallocblks, that has been conditionalized in
2002 and #if 0'ed in 2005. It would need a considerable amount of work
to bring back and obscures the more important block allocation.
2008-11-06 22:31:08 +00:00
joerg 564d6ccca2 Fix indentation. 2008-10-30 17:03:09 +00:00
hannken 06529f4f6d Correct previous.
- Count frags, not blocks to get the file system size.
- Cannot use blksize() here, it depends on vnode size.
- Correctly update xfersize on short reads.
2008-10-23 17:16:24 +00:00
hannken 02630b7919 When computing the requests hard limit in ffs_snapshot_read()
use the file system size, not the size of the snapshot vnode.
2008-10-23 14:25:21 +00:00
hannken ac6b16172a Make genfs_directio() IO_JOURNALLOCKED aware. DirectIO no longer triggers
"locking against myself" panic in wapbl_begin().

Observed and tested by: Frank Kardel <kardel@netbsd.org>
2008-10-19 18:17:13 +00:00
hannken 44f3404f57 Break a deadlock where one thread has a wapbl transaction, calls VOP_GETPAGES
and wants to busy a page  while  another thread calls VOP_PUTPAGES on the same
vnode, takes pages busy and wants to start a wapbl transaction.

Reviewed by: Jason Thorpe <thorpej@netbsd.org>
2008-10-10 09:21:58 +00:00
pooka fb58d5d6ec #error if WABPL_DEBUG_INODES is defined. That code has bitrotted
more than casu marzu cheese.
2008-10-08 22:58:56 +00:00
pooka ed8826a34e Remove some of my debugging code which was not meant to be committed
in the wapbl merge.
2008-09-23 15:27:59 +00:00
christos 8d896b1fc3 fix reversed comment, from anon ymous 2008-09-23 12:37:05 +00:00