Commit Graph

1585 Commits

Author SHA1 Message Date
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
freza
4ebea2e5f3 Revert previous, pooka@ points out it's wrong. 2008-09-21 23:22:00 +00:00
freza
262577121d WAPBL: in '%s: replaying log to disk' message use the path we're
trying to mount on instead of the misleading last-mounted-on
    path. Reported by jmcneill.
2008-09-21 21:08:22 +00:00
hannken
72538db7ba Adjust some WAPBL transactions:
- Put transaction inside cgaccount() to simplify caller.
- No vget() / vrele() inside a transaction.
2008-09-08 14:22:31 +00:00
joerg
fe12f360b8 Move successful removal of unreferenced inodes under WAPBL_DEBUG to not
spam the console.

OK simon@
2008-09-08 03:16:43 +00:00
hannken
15d57e4f81 Ffs_snapshot() has become a huge monster over the time. Break it into
helper functions to enhance readability.  Adjust comments to reality
and test the main error paths.

While here, expand and remove the last FreeBSD->NetBSD conversion macros.

No functional change intended.
2008-09-02 08:51:46 +00:00
hannken
ced96ac82f ffs_truncate() always runs with journal locked. Propagate this information
to VOP_PUTPAGES().

Report from Lars Nordlund on current-users@
2008-08-30 08:25:53 +00:00
hannken
86492b8668 Sync the just created snapshot to disk.
Invalidate short ( < fs_bsize ) buffers.  We will always read full
size buffers later.

Should fix PR #39402
2008-08-25 13:34:53 +00:00
hannken
24b2cb27c8 Add missing vput() for logvp.
Fixes PR #39400
2008-08-24 15:33:37 +00:00
hannken
83fe3aa0dd Merge the _ufs1 and _ufs2 variants of the expunge and accounting functions.
Remove some unneeded UFS_FSNEEDSWAP().

Saves ~250 lines of redundant code.
2008-08-24 09:51:47 +00:00
hannken
88400c4373 Add snapshot support for logging ffs file systems.
- Add UFS_WAPBL_BEGIN() / UFS_WAPBL_END() where needed.

- Expunge WAPBL log inodes from snapshots.

- Ffs_copyonwrite() and ffs_snapblkfree() must run inside a WAPBL transaction.

- Add ffs_gop_write() as a wrapper around genfs_gop_write() that makes sure
  genfs_gop_write() gets always called inside a WAPBL transaction.

- Add VOP_PUTPAGES() flag PGO_JOURNALLOCKED to tag calls to VOP_PUTPAGES()
  inside a WAPBL transaction.

Reviewed by: Simon Burge <simonb@netbsd.org>,  Greg Oster <oster@netbsd.org>

PGO_JOURNALLOCKED / ffs_gop_write() part presented on tech-kern@.
2008-08-22 10:48:22 +00:00
hannken
9d026d04ef ffs_suspendctl: make sure everything is on disk and the on disk log is empty. 2008-08-15 17:32:32 +00:00
matt
8165c33c80 Implement following constants and add support their to the UFS family of file
systems:
	_PC_2_SYMLINKS
	_PC_SYMLINK_MAX

From andy dot shevchenko at gmail dot com.
2008-08-14 16:19:25 +00:00
hannken
93d3ff0e45 Deny read/write access to snapshot vnodes. We use fss(4) to read from
snapshots.  With this policy in place:

- Separate the snapshot vnode lock from the snapshot common lock.
  Snapshots no longer need recursive vnode locks.

- Use a mutex (si_snaplock) to serialize creation, deletion, reading and
  writing of snapshots.

- Move ffs_read() for snapshots into ffs_snapshot.c.

Reviewed by: Jason Thorpe <thorpej@netbsd.org>

While here change ffs_copyonwrite() to fail requests from pagedaemon that need
to copy-on-write.
2008-08-12 10:14:37 +00:00
oster
328f49787a Define UFS_WAPBL_UNREGISTER_INODE() and UFS_WAPBL_REGISTER_INODE()
to something that pacifies the compiler in the non-WAPBL case.

Fix suggested by Martin Husemann.  Fixes PR#39302.
2008-08-06 21:18:59 +00:00
hannken
601ab263e0 Do not call UFS_WAPBL_*() when ffs_freefile() is acting on a snapshot.
While here replace the test for VBLK with a convenience variable.
2008-08-06 12:54:26 +00:00
pooka
b43847b66c zu, not zd, to print size_t 2008-08-05 13:39:29 +00:00
simonb
ba0675032b Only allow WAPBL to operate with UFS2 style superblocks.
Problem reported by Takeshi Nakayama.
2008-08-04 15:55:11 +00:00
simonb
53aeec60eb When checking if there's enough space at the end of a partition,
compare bytes vs bytes, not sectors vs bytes.

Problem discovered and fix tested by Michael Hitch.
2008-08-02 02:23:51 +00:00
oster
9921f79434 Make MSDOS filesystems work again after WAPBL merge. Fixes a quite
repeatable panic in fstrans_getstate() found while searching for a
different USB bug.  Also makes the code somewhat more readable.

Patch from Juergen Hannken-Illjes with a small rearrangement from me.

Approved by: hannken
2008-07-31 23:49:50 +00:00
hannken
85271ee0ad Ffs snapshots don't work (yet) with WAPBL:
- no snapshot creation on logging file systems.
- refuse to mount logging file systems with persistent snapshots.

Ok: Simon Burge <simonb@netbsd.org>
2008-07-31 15:37:56 +00:00
hannken
fb6f2c9b30 Resolve a deadlock when fs_nodealloccg() initializes more inodes on
an UFS2 file system.  With the current cylinder group buffer busy it
calls ffs_getblk().  This runs through copy-on-write and may need the
current cylinder group buffer to allocate a new block for the snapshot.

While here write the cylinder group buffer synchronously after
cg_initediblk was changed because fsck_ffs will trust it.

Reviewed by: Jason Thorpe <thorpej@netbsd.org>
2008-07-31 09:35:09 +00:00