summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_extattr.c
Commit message (Collapse)AuthorAgeFilesLines
* Replace a redundant vfs_object_create() call (already done in vn_open)alfred1999-08-121-3/+4
| | | | | | with a KASSERT. Reviewed by: Eivind, Alan Cox
* Fix fd race conditions (during shared fd table usage.) Badfileops isgreen1999-08-041-3/+3
| | | | | | | | | | | | now used in f_ops in place of NULL, and modifications to the files are more carefully ordered. f_ops should also be set to &badfileops upon "close" of a file. This does not fix other problems mentioned in this PR than the first one. PR: 11629 Reviewed by: peter
* o Typo in prior version kept it from compiling (blush).imp1999-08-041-6/+9
| | | | | | | Noticed by: Nobody! o Add comment about why we restrict chflags to root for devices. o nit noticed by bde wrt return values.
* brucify:imp1999-08-031-6/+6
| | | | | | | | | | | | | | | o use suser_xxx rather than suser to support JAIL code. o KNF comment convention o use vp->type rather than vaddr.type and eliminate call to VOP_GETATTR. Bruce says that vp->type is valid at this point. Submitted by: bde. Not fixed: o return (value) o Comment needs to be longer and more explicit. It will be after the advisory.
* Only allow root to set file flags on devices.imp1999-08-021-1/+8
|
* lutimes() bug: FOLLOW should be NOFOLLOW for this one.green1999-07-291-2/+2
| | | | Submitted by: Dan Nelson <dnelson@emsphone.com>
* Add sysctl and support code to allow directories to be VMIO'd. The defaultalc1999-07-261-2/+2
| | | | | | setting for the sysctl is OFF, which is the historical operation. Submitted by: dillon
* This Implements the mumbled about "Jail" feature.phk1999-04-281-7/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a seriously beefed up chroot kind of thing. The process is jailed along the same lines as a chroot does it, but with additional tough restrictions imposed on what the superuser can do. For all I know, it is safe to hand over the root bit inside a prison to the customer living in that prison, this is what it was developed for in fact: "real virtual servers". Each prison has an ip number associated with it, which all IP communications will be coerced to use and each prison has its own hostname. Needless to say, you need more RAM this way, but the advantage is that each customer can run their own particular version of apache and not stomp on the toes of their neighbors. It generally does what one would expect, but setting up a jail still takes a little knowledge. A few notes: I have no scripts for setting up a jail, don't ask me for them. The IP number should be an alias on one of the interfaces. mount a /proc in each jail, it will make ps more useable. /proc/<pid>/status tells the hostname of the prison for jailed processes. Quotas are only sensible if you have a mountpoint per prison. There are no privisions for stopping resource-hogging. Some "#ifdef INET" and similar may be missing (send patches!) If somebody wants to take it from here and develop it into more of a "virtual machine" they should be most welcome! Tools, comments, patches & documentation most welcome. Have fun... Sponsored by: http://www.rndassociates.com/ Run for almost a year by: http://www.servetheweb.com/
* Suser() simplification:phk1999-04-271-13/+13
| | | | | | | | | | | | | | | | | | | 1: s/suser/suser_xxx/ 2: Add new function: suser(struct proc *), prototyped in <sys/proc.h>. 3: s/suser_xxx(\([a-zA-Z0-9_]*\)->p_ucred, \&\1->p_acflag)/suser(\1)/ The remaining suser_xxx() calls will be scrutinized and dealt with later. There may be some unneeded #include <sys/cred.h>, but they are left as an exercise for Bruce. More changes to the suser() API will come along with the "jail" code.
* Add a sysctl variable which can help stop chroot(2) escapes.phk1999-03-231-1/+45
| | | | | | | | | | | | | | | kern.chroot_allow_open_directories = 0 chroot(2) fails if there are open directories. kern.chroot_allow_open_directories = 1 (default) chroot(2) fails if there are open directories and the process is subject of a previous chroot(2). kern.chroot_allow_open_directories = anything else filedescriptors are not checked. (old behaviour). I'm very interested in reports about software which breaks when running with the default setting.
* Slight cleanup of code resurected for union mounts..julian1999-03-031-33/+35
| | | | Submitted by: Tony Finch <dot@dotat.at>
* Fix code for union mountsjulian1999-02-271-1/+23
| | | | | | Accidentally deleted by peter when he extracted the unionfs stuff in 1.109 Submitted by: Tony Finch <dot@dotat.at>
* Added a used #include (don't depend on "vnode_if.h" including <sys/buf.h>).bde1999-02-251-1/+2
|
* * Change sysctl from using linker_set to construct its tree using SLISTs.dfr1999-02-161-1/+3
| | | | | | | | | | This makes it possible to change the sysctl tree at runtime. * Change KLD to find and register any sysctl nodes contained in the loaded file and to unregister them when the file is unloaded. Reviewed by: Archie Cobbs <archie@whistle.com>, Peter Wemm <peter@netplex.com.au> (well they looked at it anyway)
* Use suser() to determine super-user-ness.phk1999-01-301-26/+16
| | | | | | Collapse some duplicated checks. Reviewed by: bde
* Fix warnings related to -Wall -Wcast-qualdillon1999-01-281-1/+3
|
* Fix warnings in preparation for adding -Wall -Wcast-qual to thedillon1999-01-271-58/+58
| | | | kernel compile
* Go back to only supporting revoke() for bdevs and cdevs. It is verybde1999-01-241-1/+5
| | | | | | | | buggy for fifos, and no one seems to have investigated its behaviour on other types of files. It has been broken since the Lite2 merge in rev.1.54. Nagged about by: Brian Feldman (green@unixhelp.org)
* Remove the 'waslocked' parameter to vfs_object_create().eivind1999-01-051-2/+2
|
* PR: kern/8965dillon1998-12-121-1/+3
| | | | | | | | | Obtained from: Stephen Clawson <sclawson@cs.utah.edu> Wakeup anyone waiting on a mount point prior to returning from umount, whether an error occurs or not. Fixes a stat/NFS-umount race and other potential future problems. Fix taken from bug/pr which also indicated that the same fix has already been applied to OpenBSD and NetBSD.
* make mount(2) automatically kldload modules if the requested filesystempeter1998-11-031-3/+32
| | | | isn't present.
* Change the #ifdef UNION code into a callable hook. Arrange to have thispeter1998-11-031-114/+15
| | | | set up when unionfs is present, either statically or as a kld module.
* The last argument to vm_object_page_clean() are now bit flags, rather thanpeter1998-10-311-2/+2
| | | | | | | | | | | | the old true/false. While here, have vfs_msync() only call vm_object_page_clean() with OBJPC_SYNC if called with MNT_WAIT flags. vfs_msync() is called at unmount time (with MNT_WAIT) and from the syncer process (formerly update). This should make dirty mmap writebacks a little less nasty. I have tested this a little with SOFTUPDATES enabled, but I don't normally use it since I've been badly burned too many times.
* Eliminate a race in VOP_FSYNC() when softupdates is enabled.luoqi1998-09-241-36/+15
| | | | | | | | | | Submitted by: Kirk McKusick <mckusick@McKusick.COM> Two minor changes are also included, 1. Remove gratuitious checks for error return from vn_lock with LK_RETRY set, vn_lock should always succeed in these cases. 2. Back out change rev. 1.36->1.37, which unnecessarily makes async mount a little more unstable. It also keeps us in sync with other BSDs. Suggested by: Bruce Evans <bde@zeta.org.au>
* Don't keep the underlying directory locked while performing the filetegge1998-09-101-4/+16
| | | | | system specific VFS_MOUNT operation. PR: 1067
* Cast pointers to uintptr_t/intptr_t instead of to u_long/long,bde1998-07-151-2/+2
| | | | | | | respectively. Most of the longs should probably have been u_longs, but this changes is just to prevent warnings about casts between pointers and integers of different sizes, not to fix poorly chosen types.
* Reset MNT_ASYNC flag if needed if unmount() should fail.dg1998-07-031-1/+4
| | | | Submitted by: Paul Saab <paul@mu.org>
* Remove some junk left over from a previous commit.dyson1998-06-081-6/+1
| | | | Submitted by: phk
* This commit fixes various 64bit portability problems required fordfr1998-06-071-2/+2
| | | | | | | | | | FreeBSD/alpha. The most significant item is to change the command argument to ioctl functions from int to u_long. This change brings us inline with various other BSD versions. Driver writers may like to use (__FreeBSD_version == 300003) to detect this change. The prototype FreeBSD/alpha machdep will follow in a couple of days time.
* Fix the futimes/undelete/utrace conflict with other BSD's. Note thatdyson1998-05-111-75/+336
| | | | | | | the only common usage of utrace (the possible problem with this commit) is with malloc, so this should be a real problem. Add the various NetBSD syscalls that allow full emulation of their development environment.
* In the words of the submitter:msmith1998-05-071-17/+23
| | | | | | | | | | | | | | | | | | | --------- Make callers of namei() responsible for releasing references or locks instead of having the underlying filesystems do it. This eliminates redundancy in all terminal filesystems and makes it possible for stacked transport layers such as umapfs or nullfs to operate correctly. Quality testing was done with testvn, and lat_fs from the lmbench suite. Some NFS client testing courtesy of Patrik Kudo. vop_mknod and vop_symlink still release the returned vpp. vop_rename still releases 4 vnode arguments before it returns. These remaining cases will be corrected in the next set of patches. --------- Submitted by: Michael Hancock <michaelh@cet.co.jp>
* Backed out lseek changes.des1998-04-191-6/+4
|
* Return EINVAL and do not change file pointer if resulting offset is negative.des1998-04-181-5/+7
| | | | PR: kern/6184
* New mount option nosymfollow. If enabled, the kernel lookup()wosch1998-04-081-5/+3
| | | | | function will not follow symbolic links on the mounted file system and return EACCES (Permission denied).
* Correct a significant problem with the softupdates port. Allow fsyncdyson1998-03-291-4/+11
| | | | | to work properly within the softupdates framework, and thereby eliminate some unfortunate panics.
* Reviewed by: dyson@freebsd.org (john Dyson), dg@root.com (david greenman)julian1998-03-081-7/+22
| | | | | Submitted by: Kirk McKusick (mcKusick@mckusick.com) Obtained from: WHistle development tree
* This mega-commit is meant to fix numerous interrelated problems. Theredyson1998-03-071-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | has been some bitrot and incorrect assumptions in the vfs_bio code. These problems have manifest themselves worse on NFS type filesystems, but can still affect local filesystems under certain circumstances. Most of the problems have involved mmap consistancy, and as a side-effect broke the vfs.ioopt code. This code might have been committed seperately, but almost everything is interrelated. 1) Allow (pmap_object_init_pt) prefaulting of buffer-busy pages that are fully valid. 2) Rather than deactivating erroneously read initial (header) pages in kern_exec, we now free them. 3) Fix the rundown of non-VMIO buffers that are in an inconsistent (missing vp) state. 4) Fix the disassociation of pages from buffers in brelse. The previous code had rotted and was faulty in a couple of important circumstances. 5) Remove a gratuitious buffer wakeup in vfs_vmio_release. 6) Remove a crufty and currently unused cluster mechanism for VBLK files in vfs_bio_awrite. When the code is functional, I'll add back a cleaner version. 7) The page busy count wakeups assocated with the buffer cache usage were incorrectly cleaned up in a previous commit by me. Revert to the original, correct version, but with a cleaner implementation. 8) The cluster read code now tries to keep data associated with buffers more aggressively (without breaking the heuristics) when it is presumed that the read data (buffers) will be soon needed. 9) Change to filesystem lockmgr locks so that they use LK_NOPAUSE. The delay loop waiting is not useful for filesystem locks, due to the length of the time intervals. 10) Correct and clean-up spec_getpages. 11) Implement a fully functional nfs_getpages, nfs_putpages. 12) Fix nfs_write so that modifications are coherent with the NFS data on the server disk (at least as well as NFS seems to allow.) 13) Properly support MS_INVALIDATE on NFS. 14) Properly pass down MS_INVALIDATE to lower levels of the VM code from vm_map_clean. 15) Better support the notion of pages being busy but valid, so that fewer in-transit waits occur. (use p->busy more for pageouts instead of PG_BUSY.) Since the page is fully valid, it is still usable for reads. 16) It is possible (in error) for cached pages to be busy. Make the page allocation code handle that case correctly. (It should probably be a printf or panic, but I want the system to handle coding errors robustly. I'll probably add a printf.) 17) Correct the design and usage of vm_page_sleep. It didn't handle consistancy problems very well, so make the design a little less lofty. After vm_page_sleep, if it ever blocked, it is still important to relookup the page (if the object generation count changed), and verify it's status (always.) 18) In vm_pageout.c, vm_pageout_clean had rotted, so clean that up. 19) Push the page busy for writes and VM_PROT_READ into vm_pageout_flush. 20) Fix vm_pager_put_pages and it's descendents to support an int flag instead of a boolean, so that we can pass down the invalidate bit.
* Make the rootdir handling more consistent. Now, processes alwaysdyson1998-02-151-3/+2
| | | | | | have a root vnode associated with them, and no special checks for the null case are needed. Submitted by: terry@freebsd.org
* Fix a problem with vn_lock in fsync.dyson1998-02-081-8/+9
|
* Back out DIAGNOSTIC changes.eivind1998-02-061-4/+1
|
* Turn DIAGNOSTIC into a new-style option.eivind1998-02-041-1/+4
|
* Make our v_usecount vnode reference count work identically to thedyson1998-01-061-15/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | original BSD code. The association between the vnode and the vm_object no longer includes reference counts. The major difference is that vm_object's are no longer freed gratuitiously from the vnode, and so once an object is created for the vnode, it will last as long as the vnode does. When a vnode object reference count is incremented, then the underlying vnode reference count is incremented also. The two "objects" are now more intimately related, and so the interactions are now much less complex. When vnodes are now normally placed onto the free queue with an object still attached. The rundown of the object happens at vnode rundown time, and happens with exactly the same filesystem semantics of the original VFS code. There is absolutely no need for vnode_pager_uncache and other travesties like that anymore. A side-effect of these changes is that SMP locking should be much simpler, the I/O copyin/copyout optimizations work, NFS should be more ponderable, and further work on layered filesystems should be less frustrating, because of the totally coherent management of the vnode objects and vnodes. Please be careful with your system while running this code, but I would greatly appreciate feedback as soon a reasonably possible.
* Lots of improvements, including restructring the caching and managementdyson1997-12-291-7/+3
| | | | | | | | | | | | | | of vnodes and objects. There are some metadata performance improvements that come along with this. There are also a few prototypes added when the need is noticed. Changes include: 1) Cleaning up vref, vget. 2) Removal of the object cache. 3) Nuke vnode_pager_uncache and friends, because they aren't needed anymore. 4) Correct some missing LK_RETRY's in vn_lock. 5) Correct the page range in the code for msync. Be gentle, and please give me feedback asap.
* Unspammed nested include of <vm/vm_zone.h>.bde1997-12-271-1/+2
|
* Make COMPAT_43 and COMPAT_SUNOS new-style options.eivind1997-12-161-1/+4
|
* Cleaned up __getcwd(). This should be cosmetic except disabled callsbde1997-12-021-11/+10
| | | | | | are now counted. Reviewed by: phk
* Staticized.bde1997-11-221-3/+3
| | | | | | | Use OID_AUTO instead of a magic number for the debug.syncprt sysctl. (This sysctl doesn't actually work. FreeBSD nuked it, but parts of it were mismerged from Lite2. It is not very good, but better than nothing.)
* Fixed rev.1.81. mp->mnt_kern_flag was restored in the non-error case ofbde1997-11-221-3/+4
| | | | | | | | | | | | | | | | | | | `mount -u'. This only matters for `mount -u' competing with unmounts. If I understand the locking correctly: if mount() blocks, then unmount() may run and set mp->kern_flag for the same mp. Then unmount() blocks waiting for mount() to finish. When unmount() continues, its MNTK flags (MNTK_UNMOUNT and MNTK_MWAIT) may have been clobbered. Didn't fix old bugs: - restoring mp->mnt_kern_flag is wrong for the same reasons in the error case. - the error case of unmount() seems to be broken too: (a) MNTK_UNMOUNT gets clobbered, although another unmount() may have set it. Perhaps it shouldn't be set until after the full lock is aquired. (b) MNTK_MWAIT isn't honoured. Fixed a nearby style bug.
* Reviewed by: hackers@freebsd.org in generaljulian1997-11-131-3/+3
| | | | | | | | | | | | | Obtained from: Whistle Communications tree Add an option to the way UFS works dependent on the SUID bit of directories This changes makes things a whole lot simpler on systems running as fileservers for PCs and MACS. to enable the new code you must 1/ enable option SUIDDIR on the kernel. 2/ mount the filesystem with option suiddir. hopefully this makes it difficult enough for people to do this accidentally. see the new chmod(2) man page for detailed info.
* Reviewed by: various.julian1997-11-121-9/+11
| | | | | | | | | | | | | | | | Ever since I first say the way the mount flags were used I've hated the fact that modes, and events, internal and exported, and short-term and long term flags are all thrown together. Finally it's annoyed me enough.. This patch to the entire FreeBSD tree adds a second mount flag word to the mount struct. it is not exported to userspace. I have moved some of the non exported flags over to this word. this means that we now have 8 free bits in the mount flags. There are another two that might well move over, but which I'm not sure about. The only user visible change would have been in pstat -v, except that davidg has disabled it anyhow. I'd still like to move the state flags and the 'command' flags apart from each other.. e.g. MNT_FORCE really doesn't have the same semantics as MNT_RDONLY, but that's left for another day.
OpenPOWER on IntegriCloud