Commit Graph

1434 Commits

Author SHA1 Message Date
plunky
5ec364d4d9 C99 section 6.7.2.3 (Tags) Note 3 states that:
A type specifier of the form

	enum identifier

  without an enumerator list shall only appear after the type it
  specifies is complete.

which means that we cannot pass an "enum vtype" argument to
kauth_access_action() without fully specifying the type first.
Unfortunately there is a complicated include file loop which
makes that difficult, so convert this minimal function into a
macro (and capitalize it).

(ok elad@)
2013-03-18 19:35:35 +00:00
yamt
ca4fff9c14 comments
use sizeof(var) instead of sizeof(type) where possibly confusing
2013-03-06 11:40:22 +00:00
yamt
03d1621dc1 comment 2013-03-06 11:39:37 +00:00
christos
db2e654869 A little more debugging. 2013-01-28 00:17:18 +00:00
christos
50df1c7d20 don't need sys/mount.h in userland. 2013-01-27 22:04:19 +00:00
christos
3c0f9bd4e8 tidy up debugging printfs; no functional change. 2013-01-27 20:15:58 +00:00
christos
1ed2e30d40 fix fstat build. 2013-01-26 19:45:02 +00:00
christos
691bcd5dbb more cross-compile friendly. 2013-01-26 16:51:51 +00:00
christos
929f8943ca expose more stuff if MAKEFS is defined for the headers, and arrange for
the source file to be compilable from userland.
2013-01-26 00:21:49 +00:00
pooka
a0e33ce1e2 Do the protocol consistency check hack only when compiling ELF. 2013-01-16 21:10:14 +00:00
hannken
d845821cd8 Move the initialization of n to after the error branch.
From Taylor R Campbell <riastradh@netbsd.org>
2012-12-28 08:03:59 +00:00
hannken
1a15b095d2 Revert rev. 1.20 now that bread() has been fixed.
PR kern/46282 (6.0_BETA crash: msdosfs_bmap -> pcbmap -> bread -> bio_doread)
2012-12-20 11:44:39 +00:00
hannken
312d89f0de Change bread() and breadn() to never return a buffer on
error and modify all callers to not brelse() on error.

Welcome to 6.99.16

PR kern/46282 (6.0_BETA crash: msdosfs_bmap -> pcbmap -> bread -> bio_doread)
2012-12-20 08:03:41 +00:00
msaitoh
b6e1d8e8d8 Fix off by one error. 2012-12-07 06:50:15 +00:00
mbalmer
e3f283b63f Fix misspelling: accommodate is a long enough word to have room for two 'c's
and two 'm's.
2012-12-01 11:41:49 +00:00
nakayama
fb4e31b6db Improve smbfs timestamp handling.
Don't round timestamp to 2 seconds resolution if the server
supports the CAP_INFOLEVEL_PASSTHRU capability.
2012-11-30 23:24:21 +00:00
nakayama
33e8b488e1 - Remove redundant vput() before vgone().
- Avoid unnecessary mutex_exit() in smbfs_node_alloc().
- Set NGONE bit to from-name vnode to invalidate the smbnode cache.
2012-11-29 11:58:49 +00:00
nakayama
9dae46742e Various fixes for smbfs:
- Implement NGONE to fix caching issue described in PR kern/25070.
  Mostly taken from FreeBSD r125637.

- Revert revision 1.70 of smbfs_vnops.c to fix setattr to opened
  direcotry.  In case of SMB_CAP_NT_SMBS, NOPEN is set after
  smbfs_smb_ntcreatex() call.  If NOPEN is set in front, it will
  immediately return by condition at do_open label.

- In smbfs_close(), call smbfs_smb_close() and drop NOPEN bit in
  the case of direcotry.  Otherwise smbfs_rmdir() fails when the
  directory was opened.
2012-11-28 13:34:24 +00:00
nakayama
5f60ff96cb - fix endian cofusion around FID, which is used as is, so no need
to do byte swapping.
- put right value to ByteCount of SMB_COM_NT_CREATE_ANDX request.

The fix makes smbfs actually works on big-endian port.
2012-11-24 19:48:24 +00:00
dholland
35ed690545 Excise struct componentname from the namecache.
This uglifies the interface, because several operations need to be
passed the namei flags and cache_lookup also needs for the time being
to be passed cnp->cn_nameiop. Nonetheless, it's a net benefit.

The glop should be able to go away eventually but requires structural
cleanup elsewhere first.

This change requires a kernel bump.
2012-11-05 17:27:37 +00:00
dholland
1617a81dd1 Disentangle the namecache from the internals of namei.
- Move the namecache's hash computation to inside the namecache code,
instead of being spread out all over the place. Remove cn_hash from
struct componentname and delete all uses of it.

 - It is no longer necessary (if it ever was) for cache_lookup and
cache_lookup_raw to clear MAKEENTRY from cnp->cn_flags for the cases
that cache_enter already checks for.

 - Rearrange the interface of cache_lookup (and cache_lookup_raw) to
make it somewhat simpler, to exclude certain nonexistent error
conditions, and (most importantly) to make it not require write access
to cnp->cn_flags.

This change requires a kernel bump.
2012-11-05 17:24:09 +00:00
dholland
26486df952 Fix build of fs/unionfs (the extra unused copy of onionfs) for the
quota changes.
2012-11-05 17:16:59 +00:00
jakllsch
48958e522b Stylistic changes in comments/strings:
"FAT" and "fat" are different things, use the appropriate case.
"GEMDOS" is all caps.
2012-11-04 17:57:59 +00:00
jakllsch
1203d9864d And correct a typo that wasn't corrected in previous. 2012-11-04 17:35:27 +00:00
jakllsch
3a46a43ff0 Correct constant in comment to match the expression it is derived from. 2012-11-04 17:33:46 +00:00
jakllsch
a8a5260437 Check that the FSInfo block's next free cluster suggestion is actually
a cluster within the bounds of the volume too.
2012-11-04 17:18:56 +00:00
jakllsch
1afc21ab39 ((u_long)-1) will not always be 0xffffffff, which is what we actually
want to test against to determine if the FSInfo block's next free
cluster suggestion is valid
2012-11-04 17:16:37 +00:00
christos
81f024e94e rename ptyfs_flag -> ptyfs_status to avoid confusion with ptyfs_flags 2012-10-24 23:36:15 +00:00
christos
0966ff043a fix the mystery of the bad directory times. 2012-10-23 23:31:00 +00:00
jakllsch
8b020b7eee We don't actually want to round the number of elements in the bitmap
down.  Fixes a self-inflicted buffer overrun.

(This was detected by chance that the top of the bitmap coincided with
a page boundary.)
2012-10-03 23:32:43 +00:00
mlelstv
c7b0abd4dd Use getdisksize() to find out geometry, fetch only other magic values
from disklabel.
2012-10-03 07:20:50 +00:00
riastradh
7fad9ac861 Uncomment call to genfs_rename_cache_purge.
Fixes a side issue mentioned in PR kern/46990.

I left this commented to preserve the old behaviour of tmpfs_rename,
but it is obviously broken to omit the cache purge, and I'm surprised
nobody had encountered any problems with it until now.
2012-09-27 17:40:51 +00:00
riastradh
d0eacb2c29 Check tmpfs_rmdired_p after tmpfs_vnode_get when walking up the tree.
tmpfs_vnode_get drops all locks except possibly the reclaiming bit
lock to keep the tmpfs node from being reclaimed while we're still
interested in it.  Consequently, it does not keep the directory's
existence invariant, so we must check that after tmpfs_vnode_get.

Fixes PR kern/46990.  Tested by Wolfgang Stukenbrock.
2012-09-25 16:11:42 +00:00
christos
c209ba9c66 let us get mounted multiple times. 2012-09-18 23:42:52 +00:00
christos
381769fc11 Always do the chroot filename mapping; it is pointless not to do it. 2012-09-18 21:33:55 +00:00
manu
ff88f232cf Missing bit in previous commit (PUFFS_KFLAG_CACHE_DOTDOT option to avoid
looking up ..)
2012-08-11 01:10:11 +00:00
manu
2a9a80bb36 Add PUFFS_KFLAG_CACHE_DOTDOT so that vnodes hold a reference on their
parent, keeping them active, and allowing to lookup .. without sending
a request to the filesystem.

Enable the featuure for perfused, as this is how FUSE works.
2012-08-10 16:49:35 +00:00
manu
9bd2034d93 Missing bit in previous commit (prevent race between create|mknod|mkdir|symlink
and reclaim)
2012-08-10 14:52:56 +00:00
manu
244cd4a742 Fix race condition between (create|mknod|mkdir|symlino) and reclaim, just
like we did it between lookup and reclaim.
2012-08-10 08:42:10 +00:00
manu
fe25386a9a Backout previous bugfix attempt for unmounts. That changes did not
address the real problem.
2012-08-09 07:46:18 +00:00
matt
b1afbb311c Fix -fno-common found by building i386/conf/ALL 2012-07-28 00:43:22 +00:00
drochner
dba2da8249 gcc -fno-common fallout 2012-07-27 22:55:29 +00:00
manu
b8b95eab4a Rename slow sopreq queue into node sopreq queue, to refet the fact that
is only intended for postponed node reclaims.
When purging the node sopreq queue, do not call puffs_msg_sendresp(), as
it makes no sense.
2012-07-27 07:38:44 +00:00
manu
efa196dac9 puffs mounts share global pools. This means that the puffs_vfsops cannot
be vfs_detach'ed by module autounload before puffs_vfsop_unmount() completes
and has freed ressource from the pools. By holding a reference on
puffs_vfsops from each mount, we ensure that no race can occur here.

Works around the crash in kern/46734
2012-07-27 07:25:56 +00:00
manu
3d50d37923 Backout NCHNAMLEN check for cache_enter. That change collided with rmind's
move of this exact check into cache_enter
2012-07-23 19:06:10 +00:00
manu
00896e49d4 Di not call cache_enter with path components bigger than NCHNAMLEN, as it
panics the kernel.
2012-07-23 12:15:30 +00:00
manu
c4b1a0ab97 Fix hang unmount bug introduced by last commit.
We introduced a slow queue for delayed reclaims, while the existing
queue for unmount, flush and exist has been renamed fast queue. Both
queues had timestamp for when an operation should be done, but it was
useless for the fast queue, which is always used to run an operation
ASAP. And the timestamp test had an error that turned ASAP into "at next
tick", but nobody what there to wake the thread at next tick, hence
the hang. The fix is to remove the useless and buggy timestamp test for
fast queue.
2012-07-22 17:40:46 +00:00
rmind
d65753d972 Move some the test for MAKEENTRY into the cache_enter(9). Make some
variables in vfs_cache.c static, __read_mostly, etc.

No objection on tech-kern@.
2012-07-22 00:53:18 +00:00
manu
8502ba8ea3 - Improve PUFFS_KFLAG_CACHE_FS_TTL by reclaiming older inactive nodes.
The normal kernel behavior is to retain inactive nodes in the freelist
until it runs out of vnodes. This has some merit for local filesystems,
where the cost of an allocation is about the same as the cost of a
lookup. But that situation is not true for distributed filesystems.
On the other hand, keeping inactive nodes for a long time hold memory
in the file server process, and when the kernel runs out of vnodes, it
produce reclaim avalanches that increase lattency for other operations.

We do not reclaim inactive vnodes immediatly either, as they may be
looked up again shortly. Instead we introduce a grace time and we
reclaim nodes that have been inactive beyond the grace time.

- Fix lookup/reclaim race condition.

The above improvement undercovered a race condition between lookup and
reclaim. If we reclaimed a vnode associated with a userland cookie while
a lookup returning that same cookiewas inprogress, then the kernel ends
up with a vnode associated with a cookie that has been reclaimed in
userland. Next operation on the cookie will crash (or at least confuse)
the filesystem.

We fix this by introducing a lookup count in kernel and userland. On
reclaim, the kernel sends the count, which enable userland to detect
situation where it initiated a lookup that is not completed in kernel.
In such a situation, the reclaim must be ignored, as the node is about
to be looked up again.
2012-07-21 05:17:10 +00:00
dsl
609d5cf3c1 Fix build - eg i386/ALL 2012-07-12 17:24:47 +00:00