Commit Graph

1572 Commits

Author SHA1 Message Date
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
simonb
0800f2fb9f Be consistent with #define<tab>. 2008-07-31 08:44:21 +00:00
simonb
36d65f1138 Merge the simonb-wapbl branch. From the original branch commit:
Add Wasabi System's WAPBL (Write Ahead Physical Block Logging)
   journaling code.  Originally written by Darrin B. Jewell while
   at Wasabi and updated to -current by Antti Kantee, Andy Doran,
   Greg Oster and Simon Burge.

OK'd by core@, releng@.
2008-07-31 05:38:04 +00:00
hannken
4685b65ada ffs_snapshot():
Release allocated indir blocks on non-softdep file systems instead
    of writing them twice.
    It is sufficient to clean dirty data pages to avoid UBC inconsistencies.

ffs_snapblkfree() and wrsnapblk():
    If a snapshots effective link count is zero there is no need
    to use synchronous writes.

ffs_copyonwrite():
    Defer locking the snapshots until there is a need to copy the block.

wrsnapblk():
    Use vn_rdwr() instead of bwrite() to write to the snapshots.
2008-07-30 10:09:30 +00:00
hannken
f67742b3c8 expunge_ufs*(): Use the buffer cache to update the inodes on the snapshot like
the rest of snapshot creation does.
2008-07-15 08:20:56 +00:00
simonb
27ae933bee Fix potential 32-bit overflow problem in the blockpref code.
mlelstv@ points out FreeBSD fixed the same thing a couple of years
ago - here's the commit message they used on rev 1.127:

   Fixes a bug that caused UFS2 filesystems bigger than 2TB to
   prematurely report that they were full and/or to panic the kernel
   with the message ``ffs_clusteralloc: allocated out of group''.

   Submitted by:   Henry Whincup <henry@jot.to>
2008-07-11 05:31:44 +00:00
ad
c4d3520a6e ufsdirhash_build: missing unlock in failure path. 2008-07-03 09:56:15 +00:00
rumble
4c59ea5a60 Fix lkm fallout from previous sysctl changes. This largely duplicates
sysctl creation code, but lkms are going away soon(ish) anyway.

Spotted by Chris Gilbert.
2008-06-28 15:50:20 +00:00
rumble
28f5ebd853 Create sysctl entries during module initialisation and destroy them
appropriately.

Many of these file systems are now ready for modularisation.
2008-06-28 01:34:05 +00:00
gmcgarry
838d34e828 fcntl(4) says the command is type int. lfs_fcntl() comment says u_long. The implementation says int. Synchronise comment with documentation and cast to int before comparison. 2008-06-24 10:47:32 +00:00
reinoud
f6a70673ba Mark a buffer busy in getnewbuf() when it came from the pool_cache since
its not on a free list.

Also change buf_init() to not automatically mark buffers `busy' since this
only makes sense for bufcache buffers.

Mark all buf_init'd buffers 'busy' on the places where they ought to be
flagged as such to not confuse the buffer cache.

Fixes PR 38923.
2008-06-17 14:53:10 +00:00
skd
66fcc9f90f Add some locking, runs with DIAGNOSTIC. 2008-06-16 02:36:27 +00:00
skd
18ccf49656 Fix two cases where we would panic locking against ourselves. 2008-06-15 21:18:06 +00:00
hannken
a618b33b8c ufs_blkatoff: Update comment. 2008-06-05 09:32:29 +00:00