Commit Graph

1325 Commits

Author SHA1 Message Date
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
uch
fa2ab7e4a5 Fix readdir eofflag(bogus eofflags was setted). getcwd works. 2011-07-13 12:28:57 +00:00
uch
7572a219c6 Fix inode update method. chown and chmod works. 2011-07-13 12:22:49 +00:00
uch
709aeb1f3a When filesize is zero, correctly return V7FS_ITERATOR_END 2011-07-13 12:18:22 +00:00
riastradh
e203e3912f Fix renaming over mismatched non-directory types in tmpfs.
Renaming a file of any non-directory type over another file of any
other non-directory type is OK -- they need not match as long as
neither is a directory, so loosen the kassert to reflect this.

XXX Need to write test cases for this.

ok dholland, rmind
2011-07-13 03:28:41 +00:00
reinoud
b2a0605256 English checked and corrected, courtisy of
Igor Sobrado <sobrado@orion.ciencias.uniovi.es> as noted in OpenBSD that has a
copy of this file.
2011-07-07 17:45:38 +00:00
manu
be95d60797 Add a flag to VOP_LISTEXTATTR(9) so that the vnode interface can tell the
filesystem in which format extended attribute shall be listed.

There are currently two formats:
- NUL-terminated strings, used for listxattr(2), this is the default.
- one byte length-pprefixed, non NUL-terminated strings, used for
  extattr_list_file(2), which is obtanined by setting the
  EXTATTR_LIST_PREFIXLEN flag to VOP_LISTEXTATTR(9)

This approach avoid the need for converting the list back and forth, except
in libperfuse, since FUSE uses NUL-terminated strings, and the kernel may
have requested EXTATTR_LIST_PREFIXLEN.
2011-07-04 08:07:29 +00:00
mrg
2624874e7c avoid some uninitialised variable warnings from GCC.
at least the puffs one seems valid, but i'm not 100% sure.
2011-07-03 08:57:43 +00:00