Commit Graph

178 Commits

Author SHA1 Message Date
kleink 0917926472 Revert rev. 1.147, as per PR kern/17411.
While a hard link to a symbolic link is not ruled out by POSIX-2001,
the link(2) interface is to perform normal pathname resolution,
which includes the resolution of symbolic links.
2002-10-30 22:36:46 +00:00
christos 2d05cb6a47 Add special handling of VFS_GETARGS (similar to VFS_UPDATE) so that it
can be done non-root, and it does not affect the mount lists.
2002-09-21 18:07:52 +00:00
matt 48bbf5f234 Use the queue macros from <sys/queue.h> instead of referring to the queue
members directly.  Use *_FOREACH whenever possible.
2002-09-04 01:32:31 +00:00
thorpej 3767580d1a Fix a signed/unsigned comparison warning from GCC 3.3. 2002-08-26 01:26:29 +00:00
enami 3700fdfba4 Don't release the lock on mount point vnode so early when doing update mount.
Otherwise, race condition occurs (e.g., between mountd(8) and next mount(8)
when multiple update mount command is invoked from shell script).
2002-05-11 00:45:06 +00:00
lukem adc783d537 add RCSIDs 2001-11-12 15:25:01 +00:00
simonb 5f717f7c33 Don't need to include <uvm/uvm_extern.h> just to include <sys/sysctl.h>
anymore.
2001-10-29 07:02:30 +00:00
christos bfe76ac87a Allow userland to pass MNT_IGNORE (from enami) 2001-10-11 16:27:24 +00:00
christos fdad5eb59c Don't trash the ref count of cred. It causes a memory leak. 2001-09-08 15:34:06 +00:00
christos f556e46298 Hijack the credentials used to evaluate access, to avoid a potential lwp
race by modifying the proc's credentials temporarily. From Bill Sommerfeld.
Thanks for forcing me to do this right :-)
2001-09-08 02:05:39 +00:00
assar bec71dc090 change vop_symlink and vop_mknod to return vpp (the created node)
refed, so that the caller can actually use it.  update callers and
file systems that implement these vnode operations
2001-07-24 15:39:30 +00:00
jdolecek 1ff201e042 Only define mountcompatnames[] for COMPAT_09 and COMPAT_43, make the
table actually match state in NetBSD 0.9 (checked against sys/mount.h
rev. 1.11).
The array is not to be modified from now on, comment updated accordingly.
2001-06-28 08:04:18 +00:00
thorpej 80cc38a1af Fix a partial construction problem that can cause race conditions
between creation of a file descriptor and close(2) when using kernel
assisted threads.  What we do is stick descriptors in the table, but
mark them as "larval".  This causes essentially everything to treat
it as a non-existent descriptor, except for fdalloc(), which sees a
filled slot so that it won't (incorrectly) allocate it again.  When
a descriptor is fully constructed, the code that has constructed it
marks it as "mature" (which actually clears the "larval" flag), and
things continue to work as normal.

While here, gather all the code that gets a descriptor from the table
into a fd_getfile() function, and call it, rather than having the
same (sometimes incorrect) code copied all over the place.
2001-06-14 20:32:41 +00:00
thorpej 5b35dc8136 When unmounting a file system, acquire the syncer_lock before
vfs_busy'ing just before the dounmount() call.  This is to avoid
sleeping with the mountlist_slock held -- but we must acquire
syncer_lock before vfs_busy because the syncer itself uses
syncer_lock -> vfs_busy locking order.
2001-04-16 22:41:09 +00:00
chs aeda8d3b77 Initial integration of the Unified Buffer Cache project. 2000-11-27 08:39:39 +00:00
enami 656bf989ab Factor out common code to manupilate file flags into separate function
like others do.
2000-09-28 06:43:20 +00:00
fvdl a6a5e6cca7 Adapt for VOP_FSYNC parameter change.
Small optimization to shutdown code: only take the syncer lock if
the FS actually used it.
2000-09-19 22:01:41 +00:00
thorpej 7cc27a88c0 Convert namei pathname buffer allocation to use the pool allocator. 2000-08-03 20:41:05 +00:00
mycroft caf07dfa04 When unmounting, make sure to free the syncer vnode so that it can be reused. 2000-07-09 00:59:03 +00:00
mrg 32aa199ccf remove include of <vm/vm.h> 2000-06-27 17:41:07 +00:00
pooka 7747299e6d Correct situation where vnode was left hanging around when trying to
mount a filesystem with securelevel 2. A second mount-attempt left
everything completely frozen.

Fix by Bill Sommerfeld.
2000-06-19 18:53:55 +00:00
fvdl 4fbe4a470d Enable passing of the MNT_SOFTDEP flag in the mount system call. 2000-06-15 22:32:44 +00:00
mrg a6f7a7855f implement lchflags(2), which does the chflags(2) dance without following
symlinks, and thus can operate on symlinks.  remove a bogus comment in
chflags(1) that claims symlinks do not have file flags.

XXX: todo -- make chflags(1) use lchflags(2) when given the right options.
2000-04-17 14:31:21 +00:00
augustss 264f1d27c6 Get rid of register declarations. 2000-03-30 09:27:11 +00:00
simonb d1f05e517a Delete redundant decl of dounmount(), it's in <sys/mount.h>. 2000-03-30 02:12:25 +00:00
thorpej dabbfde70a Implement fdremove() which is used in place of all the code that
did the "fdp->fd_ofiles[fd] = 0" assignment; fdremove() make sure
the fd_freefiles hints stay in sync.

From OpenBSD.
2000-03-23 05:16:12 +00:00
fvdl 14cbd3e2b0 In fdatasync, do not call bioops.io_fsync, since we're not flushing
metadata. If you do call it, there's actually a fair chance that it
will panic because its metadata dependencies were not cleared in
the VOP_FSYNC above (with FSYNC_DATAONLY).
2000-03-15 16:30:39 +00:00
mycroft 1d915f4130 Allow my disk to actually spin down using `-o async' again.
Note: This uses the same questionable logic as vfs_bio.c to check MNT_ASYNC.
Something needs to be done about this.
2000-03-03 05:21:03 +00:00
fvdl c13f6dd258 Introduce a sysctl to enable/disable if non-root users can mount filesystems.
Default: off.
2000-02-16 11:57:45 +00:00
assar a49e53d3df (sys_open, sys_fhopen): remove declaration of vnops, now in
<sys/file.h>
2000-02-01 01:24:38 +00:00
fvdl 0b1963121a Add Kirk McKusick's soft updates code to the trunk. Not enabled by
default, as the copyright on the main file (ffs_softdep.c) is such
that is has been put into gnusrc. options SOFTDEP will pull this
in. This code also contains the trickle syncer.

Bump version number to 1.4O
1999-11-15 18:49:07 +00:00
hubertf abda8d9447 Allow hardlinks to symlinks.
Reviewed by: Bill Studenmund, Klaus Klein
1999-09-05 23:34:39 +00:00
christos 93146392a8 OpenBSD patch to prevent non-root users who own block or character devices
(typically ttys or ptys) from changing the flags on them. [Commit by cjs.]
1999-07-31 03:18:43 +00:00
wrstuden eeefc02aec Add VLAYER to tests which will cause VOP_REVOKE to be called in sys_revoke(). 1999-07-26 19:20:09 +00:00
thorpej ea8fb3e04a Turn the proclist lock into a read/write spinlock. Update proclist locking
calls to reflect this.  Also, block statclock rather than softclock during
in the proclist locking functions, to address a problem reported on
current-users by Sean Doran.
1999-07-25 06:30:33 +00:00
thorpej 2860ae9b30 Add proclist locking where appropriate (forgot to commit this file previously). 1999-07-22 23:00:27 +00:00
sommerfeld e303e2ee8b Fix kern/7906: race between unmount and getnewvnode()
mp->mnt_flags & MNT_MWAIT is replaced by mp->mnt_wcnt, and a new mount
flag MNT_GONE is created (reusing the same bit).

In insmntque(), add DIAGNOSTIC check to fail if the filesystem vnode
is being moved to is in the process of being unmounted.

getnewvnode() now protects the list of vnodes active on mp with
vfs_busy()/vfs_unbusy().

To avoid generating spurious errors during a doomed unmount, change
the "wait for unmount to finish" protocol between dounmount() and
vfs_busy().  In vfs_busy(), instead of only sleeping once, sleep until
either MNT_UNMOUNT is clear or MNT_GONE is set; also, maintain a count
of waiters in mp->mnt_wcnt so that dounmount() knows when it's safe to
free mp.

tested by running a "while :; do mount /d1; umount -f /d1; done" loop
against multiple find(1) processes.
1999-07-04 16:20:12 +00:00
sommerfeld 6f57fc7820 fix typo in previous 1999-07-04 06:17:52 +00:00
sommerfeld c7e5c39191 Don't permanently lose the async bit on an failed unmount 1999-07-04 06:16:29 +00:00
wrstuden b101a0685c Make fhopen use FILE_UNUSE, and don't leak file descriptors.
Patch from Jason Thorpe. Also should close PR 7889 from
Assar Westerlund <assar@sics.se> describing this problem.
1999-07-01 18:58:16 +00:00
is b4b3d042fd Only check for ETXTBSY if the access would otherwise be allowed.
Needed to fix pr4134.
1999-06-30 10:00:06 +00:00
wrstuden 6e06666498 Add fhopen, fhstat, fhstatfs syscalls. Also move getfh in from the nfs
syscall code.
1999-06-29 22:18:47 +00:00
christos e649afd171 Add NTFS for the compat names. 1999-05-06 17:11:04 +00:00
thorpej e3669c3393 Add "use counting" to file entries. When closing a file, and it's reference
count is 0, wait for use count to drain before finishing the close.

This is necessary in order for multiple processes to safely share file
descriptor tables.
1999-05-05 20:01:01 +00:00
thorpej 16936c9565 Break cdir/rdir/cmask info out of struct filedesc, and put it in a new
substructure, `cwdinfo'.  Implement optional sharing of this substructure.

This is required for clone(2).
1999-04-30 18:42:58 +00:00
mycroft f145c291bd If copyout() fails, make sure to unbusy the mount point before returning. 1999-03-31 19:18:45 +00:00
mrg d2397ac5f7 completely remove Mach VM support. all that is left is the all the
header files as UVM still uses (most of) these.
1999-03-24 05:50:49 +00:00
sommerfe 6d0f67d6aa Regen files based on changes to syscalls.master, vnode_if.src (latter
was changes to comments only, but..)
Build vfs_getcwd.c as standard part of kernel.
Add implementation of fchroot(), since two emulations already had it.
Call vn_isunder() in fchdir(), chroot(), and fchroot() to make it harder
to escape chroot().
1999-03-22 17:13:34 +00:00
bouyer 87662a89a2 Hinherit MNT_NOEXEC from the mount point. Without this a user can exec
arbitrary binaries by doing a user mount, even if the admin has carefully
setup his system to avoid arbitrary binaries execution.
1999-03-17 15:35:03 +00:00
fvdl 31289a4af8 Fill in vnodecovered in the mount structure before calling VFS_MOUNT anyway,
some things (e.g. unionfs) may depend on it. It's currently ok
for vnodecovered to be set already; it's not for v_mountedhere in
the vnode, though.

From John Darrow.

XXX should probably just extend VFS_MOUNT to take the vnode pointer as
an argument.
1999-03-02 07:47:49 +00:00