Commit Graph

1332 Commits

Author SHA1 Message Date
manu
399ad65db5 Remove #ifdef DIAGNOSTIC guards around KASSERT, as the macro contains them 2011-10-19 01:39:29 +00:00
hannken
7e4dd4325b VOP_GETATTR() needs a shared lock at least.
While here fix a typo (fvp -> tvp).
2011-10-18 20:20:29 +00:00
manu
bd77be0ce7 Make sure pagedaemon does not sleep for memory in puffs_vnop_sleep.
Add KASSERT on any sleeping memory allocation to check it cannot happen again.
2011-10-18 15:39:09 +00:00
hannken
749d77682d VOP_GETATTR() needs a shared lock at least. 2011-10-18 09:22:53 +00:00
manu
7f182e39c1 Roll back the change that forced kernel threads to not sleep in PUFFS.
The change does not make consensus, since only pagedaemon should need it.
Other threads will tolerate sleeping, and problems here are only symptoms
that something is going wrong in memory management. The cause, not the
symptoms, need to be fixed.
2011-10-17 23:54:01 +00:00
hannken
2083e28d1f VOP_GETATTR() needs a shared lock at least.
While here fix a typo (fvp -> tvp).
2011-10-16 12:41:45 +00:00
hannken
34f54c83be As vnalloc() always allocates with PR_WAITOK there is no longer the need
to test its result for NULL.
2011-10-07 09:35:04 +00:00
christos
8b0d7f915b rename SMBFS_MAXFNAMELEN to SMBFS_MAXNAMLEN for consistency 2011-09-27 02:05:10 +00:00
christos
d4bb8ac2b1 don't get affected by the NAME_MAX bump. Use the same constant as the
rest of the extrattr code.
2011-09-27 01:48:57 +00:00
christos
1e439c8185 define NILFS_MAXNAMLEN and use it. 2011-09-27 01:34:41 +00:00
christos
2fcd0204c6 return UDF_MAXNAMLEN instead of NAME_MAX 2011-09-27 01:33:30 +00:00
christos
367fc9326f return TMPFS_MAXNAMLEN instead of NAME_MAX 2011-09-27 01:32:21 +00:00
christos
5377c21fee use ISO_MAXNAMLEN instead of NAME_MAX 2011-09-27 01:27:44 +00:00
christos
d30021427a use NAME_MAX instead of MAXNAMLEN 2011-09-27 01:14:47 +00:00
christos
3a8df9f090 - rename UDF_MAX_NAMELEN -> UDF_MAXNAMLEN
- use NAME_MAX instead of MAXNAMLEN
2011-09-27 01:13:16 +00:00
christos
a00d98eb66 define and use TMPFS_MAXNAMLEN instead of MAXNAMLEN 2011-09-27 01:10:43 +00:00
christos
4fa49ab869 define and use ISO_MAXNAMLEN instead of MAXNAMLEN 2011-09-27 01:01:43 +00:00
manu
38de55a5dd Fix the build that was broken by struct lwp *updateproc reference in
RUMP-visible code. Instead of checking that updateproc (aka ioflush,
aka syncer) will not sleep in PUFFS code, I check for any kernel thread:
after all none of them are designed to hang awaiting for a remote filesystem
operation to complete.
2011-09-23 01:57:32 +00:00
manu
da3795c23e Make sure ioflush does not sleep in PUFFS code path, waiting for a mutex,
a memory allocation, or a response from the filesystem.

This avoids deadlocks in the following situations:
1) when memory is low: ioflush waits the fileystem, the fielsystem waits
   for memory
2) when the filesystem does not respond (e.g.: network outage ona
   distributed filesystem)
2011-09-21 15:36:33 +00:00
christos
025e844498 don't update access/change times on open. 2011-09-16 18:43:44 +00:00
plunky
7f3d4048d7 NULL does not need a cast 2011-08-31 18:31:02 +00:00
manu
96c935e33b Add a mutex for operations that touch size (setattr, getattr, write, fsync).
This is required to avoid data corruption bugs, where a getattr slices
itself within a setattr operation, and sets the size to the stall value
it got from the filesystem. That value is smaller than the one set by
setattr, and the call to uvm_vnp_setsize() trigged a spurious truncate.
The result is a chunk of zeroed data in the file.

Such a situation can easily happen when the ioflush thread issue a
VOP_FSYNC/puffs_vnop_sync/flushvncache/dosetattrn while andother process
do a sys_stat/VOP_GETATTR/puffs_vnop_getattr.

This mutex on size operation can be removed the day we decide VOP_GETATTR
has to operated on a locked vnode, since the other operations that touch
size already require that.
2011-08-29 04:12:45 +00:00
hannken
8dc51ab7d8 Print the warning message on mount once.
Should fix PR #42795 (patch to make mounting union filesystems less obnoxious)
2011-08-28 08:27:57 +00:00
hannken
f68873a343 Finish and enable whiteout support for tmpfs:
- Enable VOP tmpfs_whiteout().
- Support ISWHITEOUT in tmpfs_alloc_file().
- Support DOWHITEOUT in tmpfs_remove() and tmpfs_rmdir().
- Make rmdir on a directory containing whiteouts working.

Should fix PR #35112 (tmpfs doesn't play well with unionfs).
2011-08-27 15:32:28 +00:00
hannken
f937bd97b7 Stop abusing relookup() to prepare the creation of new nodes
in the upper layer.
Replace union_relookup() with union_do_lookup() that prepares
a component, calls VOP_LOOKUP() and does the EEXIST test.
2011-08-23 07:39:37 +00:00
riastradh
b4d52ac6e6 Fix tmpfs_rename locking.
Fixes PR kern/36681.  tmpfs now survives dirconc, all our vfs/tmpfs
tests and rename races in atf, and a bunch of hand-written tests
that I'd commit if atf didn't find them highly indigestible.

ok dholland
2011-08-18 21:42:18 +00:00
mbalmer
0813ba11d0 Fix some typos. 2011-08-16 14:29:16 +00:00
apb
464d645aeb Rename all static functions to have "v7fs_" prefix. Fixes a problem
in the tools build, where the static link() and unlink() functions
conflicted with those declared in <unistd.h>.
2011-08-14 09:02:07 +00:00
hannken
1147247693 Use mutexes to protect the hash lists instead of tsleep/wakeup. 2011-08-13 10:48:14 +00:00
hannken
94fc281af2 Change some #ifdef DIAGNOSTIC' to KASSERT'.
Instead of a `pid_t' use a `lwp_t *' for locking diagnostics.

No functional changes intended.
2011-08-12 17:41:17 +00:00
hannken
b8e5efdc84 Add missing parts to mount devices from a union file system:
- union_close()    has to lock/unlock the lower vnode.
- union_fsync()    has to call spec_fsync() for the union vnode.
- union_strategy() must allow writes to devices on the lower file system.
- union_bwrite()   was completely missing.
2011-08-12 14:36:29 +00:00
hannken
7b19d6d068 When creating a union node representing a device initialize
the spec_node to make vrele() happy.
2011-08-12 06:40:10 +00:00
hannken
3ec6312958 Update the (shared) v_interlock if the upper node changes. 2011-08-10 15:56:01 +00:00
hannken
b80057eeb2 For devices, sockets and fifos ignore setting the file size to zero to make
open(..., O_TRUNC) happy and allow them to write through the lower layer.

Fixes PR #43560 (writing to null device in unionfs fails)
2011-08-10 06:27:02 +00:00
hannken
9be6a4a9b4 Use LK_SHARED, it is sufficient for VOP_GETATTR() and VOP_READDIR(). 2011-08-10 06:19:54 +00:00
uch
f2404aeb3c Remove suspicious warning message. 2011-08-08 11:42:30 +00:00
hannken
342315ffad Change union rmdir semantics to fail directory removal for
non-empty directories like all other file systems do.

Change test accordingly.
2011-08-07 06:01:51 +00:00
hannken
efc3d2ec25 When union_lookup() creates a shadow directory and nameiop is not LOOKUP
it has to restart the lookup to get the componentname right.

Fixes PR #44383 (an endless stream of whiteout and opaque dir problems ...)
2011-08-05 08:17:47 +00:00
dholland
66d63879a2 Insert casts to off_t to avoid 32-bit multiplication overflow when
computing device offsets on 32-bit platforms. Should fix PR 45191.
2011-08-03 16:21:52 +00:00
uch
b53b51d13e v7fs_lookup() fix return value. Pass t_vnops rename_dir(3)
v7fs_setttr() check credential. Pass t_unpriv owner
v7fs_rename() reload inode(v7fs_vnode_reload). Pass t_vnops rename_reg_nodir
2011-07-30 03:53:18 +00:00
uch
53172ceae2 When rename directory, check hierarchy. Pass t_vnops rename_dir(5) 2011-07-30 03:52:04 +00:00
uch
cba32d8fa9 Fix return vaule. Pass t_vnops:rename_dotdot, dir_noempty, rename_dir(6) 2011-07-30 03:51:53 +00:00
uch
fbcb953c8f Existing inode don't recycle. rump works. 2011-07-24 12:31:33 +00:00
uch
803c773c57 remove partition check from v7fs_mount. problem on rump implementation. 2011-07-23 05:10:30 +00:00
hannken
9f9c02f1cd Even though msdosfs never truncates file names it advertises _PC_NO_TRUNC
as zero.  Make it advertise one (no_trunc == true).

Names longer than NAME_MAX (255) will never pass namei() btw.

Fixes PR #43670 (msdosfs claims support for filenames longer than {NAME_MAX},
                 but fails)
2011-07-20 11:52:00 +00:00
apb
f1ca1ce2bf In sources that get compiled into the tools version of makefs, add:
#if HAVE_NBTOOL_CONFIG_H
#include "nbtool_config.h"
#endif

This should fix cross-build problems, but I can't really test
that now, so I am not re-enabling the inclusion of v7fs support
in makefs.
2011-07-18 21:51:49 +00:00
joerg
3eb244d801 Retire varargs.h support. Move machine/stdarg.h logic into MI
sys/stdarg.h and expect compiler to provide proper builtins, defaulting
to the GCC interface. lint still has a special fallback.
Reduce abuse of _BSD_VA_LIST_ by defining __va_list by default and
derive va_list as required by standards.
2011-07-17 20:54:30 +00:00
uch
6a2dbe9ae4 core symlink operation moved to v7fs_file_util.c and introduce V7FSBSD_MAXSYMLINKLEN for makefs 2011-07-16 12:35:40 +00:00
uch
f96feeccb7 export v7fs_datablock_addr for makefs 2011-07-16 12:35:32 +00:00
njoly
8b2b6e057f Add function name to a few debug messages. 2011-07-13 19:51:29 +00:00