aboutsummaryrefslogtreecommitdiff
path: root/sys/ufs
Commit message (Collapse)AuthorAgeFilesLines
* o Restructure vaccess() so as to check for DAC permission to modify theRobert Watson2000-08-291-1/+1
| | | | | | | | | | | | | | | | | | | object before falling back on privilege. Make vaccess() accept an additional optional argument, privused, to determine whether privilege was required for vaccess() to return 0. Add commented out capability checks for reference. Rename some variables to make it more clear which modes/uids/etc are associated with the object, and which with the access mode. o Update file system use of vaccess() to pass NULL as the optional privused argument. Once additional patches are applied, suser() will no longer set ASU, so privused will permit passing of privilege information up the stack to the caller. Reviewed by: bde, green, phk, -security, others Obtained from: TrustedBSD Project Notes: svn path=/head/; revision=65200
* o Correct spelling of ufs_exttatr_find_attr -> ufs_extattr_find_attrRobert Watson2000-08-262-22/+22
| | | | | | | | | | o Add "const" qualifier to attrname argument of various calls to remove warnings Obtained from: TrustedBSD Project Notes: svn path=/head/; revision=65119
* Remove all traces of Julians DEVFS (incl from kern/subr_diskslice.c)Poul-Henning Kamp2000-08-201-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove old DEVFS support fields from dev_t. Make uid, gid & mode members of dev_t and set them in make_dev(). Use correct uid, gid & mode in make_dev in disk minilayer. Add support for registering alias names for a dev_t using the new function make_dev_alias(). These will show up as symlinks in DEVFS. Use makedev() rather than make_dev() for MFSs magic devices to prevent DEVFS from noticing this abuse. Add a field for DEVFS inode number in dev_t. Add new DEVFS in fs/devfs. Add devfs cloning to: disk minilayer (ie: ad(4), sd(4), cd(4) etc etc) md(4), tun(4), bpf(4), fd(4) If DEVFS add -d flag to /sbin/inits args to make it mount devfs. Add commented out DEVFS to GENERIC Notes: svn path=/head/; revision=64880
* Centralize the canonical vop_access user/group/other check in vaccess().Poul-Henning Kamp2000-08-201-41/+3
| | | | | | | Discussed with: bde Notes: svn path=/head/; revision=64865
* Initialize *countp to 0 in stub for softdep_flushworklist().Tor Egge2000-08-091-0/+1
| | | | | | | | | This allows ffs_fsync() to break out of a loop that might otherwise be infinite on kernels compiled without the SOFTUPDATES option. The observed symptom was a system hang at the first unmount attempt. Notes: svn path=/head/; revision=64437
* Fix the lockmgr panic everyone is seeing at shutdown time.Ollivier Robert2000-08-011-1/+2
| | | | | | | | | | | | vput assumes curproc is the lock holder, but it's not true in this case. Thanks a lot Luoqi ! Submitted by: luoqi Tested by: phk Notes: svn path=/head/; revision=64104
* Minor tweak - removed unused variable 'struct mount *mp';Peter Wemm2000-07-281-1/+0
| | | | Notes: svn path=/head/; revision=63976
* Minor change: fix warning - move a 'struct vnode *vp' declaration inside aPeter Wemm2000-07-281-0/+2
| | | | | | | #ifdef DIAGNOSTIC to match its corresponding usage. Notes: svn path=/head/; revision=63975
* Clean up the snapshot code so that it no longer depends on the use ofKirk McKusick2000-07-264-12/+37
| | | | | | | | | | | | | | | | | the SF_IMMUTABLE flag to prevent writing. Instead put in explicit checking for the SF_SNAPSHOT flag in the appropriate places. With this change, it is now possible to rename and link to snapshot files. It is also possible to set or clear any of the owner, group, or other read bits on the file, though none of the write or execute bits can be set. There is also an explicit test to prevent the setting or clearing of the SF_SNAPSHOT flag via chflags() or fchflags(). Note also that the modify time cannot be changed as it needs to accurately reflect the time that the snapshot was taken. Submitted by: Robert Watson <rwatson@FreeBSD.org> Notes: svn path=/head/; revision=63897
* Fix the "mfs_badop[vop_getwritemount] = 45" messages.Poul-Henning Kamp2000-07-261-0/+1
| | | | Notes: svn path=/head/; revision=63889
* Add stub for softdep_flushworklist() so that kernels compiledKirk McKusick2000-07-251-0/+10
| | | | | | | | | without the SOFTUPDATES option will load correctly. Obtained from: John Baldwin <jhb@bsdi.com> Notes: svn path=/head/; revision=63829
* Eliminate periodic 'mfs_badop[vop_getwritemount] = 45' messages.Kirk McKusick2000-07-251-0/+1
| | | | | | | Submitted by: Sheldon Hearn <sheldonh@uunet.co.za> Notes: svn path=/head/; revision=63828
* This patch corrects the first round of panics and hangs reportedKirk McKusick2000-07-249-75/+152
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | with the new snapshot code. Update addaliasu to correctly implement the semantics of the old checkalias function. When a device vnode first comes into existence, check to see if an anonymous vnode for the same device was created at boot time by bdevvp(). If so, adopt the bdevvp vnode rather than creating a new vnode for the device. This corrects a problem which caused the kernel to panic when taking a snapshot of the root filesystem. Change the calling convention of vn_write_suspend_wait() to be the same as vn_start_write(). Split out softdep_flushworklist() from softdep_flushfiles() so that it can be used to clear the work queue when suspending filesystem operations. Access to buffers becomes recursive so that snapshots can recursively traverse their indirect blocks using ffs_copyonwrite() when checking for the need for copy on write when flushing one of their own indirect blocks. This eliminates a deadlock between the syncer daemon and a process taking a snapshot. Ensure that softdep_process_worklist() can never block because of a snapshot being taken. This eliminates a problem with buffer starvation. Cleanup change in ffs_sync() which did not synchronously wait when MNT_WAIT was specified. The result was an unclean filesystem panic when doing forcible unmount with heavy filesystem I/O in progress. Return a zero'ed block when reading a block that was not in use at the time that a snapshot was taken. Normally, these blocks should never be read. However, the readahead code will occationally read them which can cause unexpected behavior. Clean up the debugging code that ensures that no blocks be written on a filesystem while it is suspended. Snapshots must explicitly label the blocks that they are writing during the suspension so that they do not cause a `write on suspended filesystem' panic. Reorganize ffs_copyonwrite() to eliminate a deadlock and also to prevent a race condition that would permit the same block to be copied twice. This change eliminates an unexpected soft updates inconsistency in fsck caused by the double allocation. Use bqrelse rather than brelse for buffers that will be needed soon again by the snapshot code. This improves snapshot performance. Notes: svn path=/head/; revision=63788
* o Marius pointed out an unusually inconvenient upper bound on extendedRobert Watson2000-07-141-1/+0
| | | | | | | | | | | | attribute data size. o Fortunately it turned out to be an unused constant left over from an earlier implementation, and is therefore being removed so as not to confuse casual observers. Submitted by: mbendiks@eunet.no Notes: svn path=/head/; revision=63099
* Prevent possible dereference of NULL pointer.Boris Popov2000-07-131-1/+1
| | | | | | | Submitted by: Marius Bendiksen <mbendiks@eunet.no> Notes: svn path=/head/; revision=63059
* Brain fault, forgot to update ffs_snapshot.c with the new calling conventionKirk McKusick2000-07-121-4/+5
| | | | | | | for vn_start_write. Notes: svn path=/head/; revision=62985
* Add snapshots to the fast filesystem. Most of the changes supportKirk McKusick2000-07-1115-184/+1365
| | | | | | | | | | | | | | | | | | | | | | | the gating of system calls that cause modifications to the underlying filesystem. The gating can be enabled by any filesystem that needs to consistently suspend operations by adding the vop_stdgetwritemount to their set of vnops. Once gating is enabled, the function vfs_write_suspend stops all new write operations to a filesystem, allows any filesystem modifying system calls already in progress to complete, then sync's the filesystem to disk and returns. The function vfs_write_resume allows the suspended write operations to begin again. Gating is not added by default for all filesystems as for SMP systems it adds two extra locks to such critical kernel paths as the write system call. Thus, gating should only be added as needed. Details on the use and current status of snapshots in FFS can be found in /sys/ufs/ffs/README.snapshot so for brevity and timelyness is not included here. Unless and until you create a snapshot file, these changes should have no effect on your system (famous last words). Notes: svn path=/head/; revision=62976
* Clean up warning about undeclared function by declaring softdep_fsyncKirk McKusick2000-07-111-0/+3
| | | | | | | | | in mount.h instead of ffs_extern.h. The correct solution is to use an indirect function pointer so that the kernel does not have to be built with options FFS, but that will be left for another day. Notes: svn path=/head/; revision=62968
* Finish repo-copy:Poul-Henning Kamp2000-07-101-409/+0
| | | | | | | | | Move ufs/ufs/ufs_disksubr.c to kern/subr_disklabel.c. These functions are not UFS specific and are in fact used all over the place. Notes: svn path=/head/; revision=62907
* Delete README as it is now obsolete. Relevant information is inKirk McKusick2000-07-081-322/+0
| | | | | | | README.softupdates. Notes: svn path=/head/; revision=62799
* Update to reflect current status.Kirk McKusick2000-07-081-4/+42
| | | | Notes: svn path=/head/; revision=62798
* Get userland visible flags added for snapshots to give a few daysKirk McKusick2000-07-041-1/+26
| | | | | | | | | advance preparation for them to get migrated into place so that subsequent changes in utilities will not fail to compile for lack of up-to-date header files in /usr/include. Notes: svn path=/head/; revision=62553
* Move the truncation code out of vn_open and into the open system callKirk McKusick2000-07-042-4/+6
| | | | | | | | | | | | | after the acquisition of any advisory locks. This fix corrects a case in which a process tries to open a file with a non-blocking exclusive lock. Even if it fails to get the lock it would still truncate the file even though its open failed. With this change, the truncation is done only after the lock is successfully acquired. Obtained from: BSD/OS Notes: svn path=/head/; revision=62550
* Make the two calls from kern/* into softupdates #ifdef SOFTUPDATES,Poul-Henning Kamp2000-07-031-15/+0
| | | | | | | | | | that is way cleaner than using the softupdates_stub stunt, which should be killed when convenient. Discussed with: mckusick Notes: svn path=/head/; revision=62469
* Move prtactive to vfs from ufs. It is used all over the place.Poul-Henning Kamp2000-06-271-2/+0
| | | | Notes: svn path=/head/; revision=62148
* Remove obsoleted info about linking from contribAndrey A. Chernov2000-06-241-16/+2
| | | | Notes: svn path=/head/; revision=62033
* Update to new copyright.Kirk McKusick2000-06-222-46/+12
| | | | Notes: svn path=/head/; revision=61926
* When running with quotas enabled on a filesystem using soft updates,Kirk McKusick2000-06-181-2/+3
| | | | | | | | | | | the system would panic when a user's inode quota was exceeded (see PR 18959 for details). This fixes that problem. PR: 18959 Submitted by: Jason Godsey <jason@unixguy.fidalgo.net> Notes: svn path=/head/; revision=61813
* Some additional performance improvements. When freeing an inodeKirk McKusick2000-06-181-8/+18
| | | | | | | | | | | | | check to see if it has been committed to disk. If it has never been written, it can be freed immediately. For short lived files this change allows the same inode to be reused repeatedly. Similarly, when upgrading a fragment to a larger size, if it has never been claimed by an inode on disk, it too can be freed immediately making it available for reuse often in the next slowly growing block of the same file. Notes: svn path=/head/; revision=61812
* Revert part of my bioops change which implemented panic(8).Poul-Henning Kamp2000-06-161-2/+0
| | | | Notes: svn path=/head/; revision=61730
* ARGH! I have too many source trees :-(Poul-Henning Kamp2000-06-163-4/+4
| | | | | | | Fix prototype errors in last commit. Notes: svn path=/head/; revision=61729
* Virtualizes & untangles the bioops operations vector.Poul-Henning Kamp2000-06-163-4/+21
| | | | | | | Ref: Message-ID: <18317.961014572@critter.freebsd.dk> To: current@ Notes: svn path=/head/; revision=61724
* Remove a comment which should never have made it in.Poul-Henning Kamp2000-06-141-1/+0
| | | | Notes: svn path=/head/; revision=61698
* o Remove unneeded off_t variable to clean up compile warningRobert Watson2000-06-051-1/+1
| | | | | | | Obtained from: TrustedBSD Project Notes: svn path=/head/; revision=61281
* o If FFS_EXTATTR is defined, don't print out an error message on unmountRobert Watson2000-06-041-3/+4
| | | | | | | | | if an FFS partition returns EOPNOTSUPP, as it just means extended attributes weren't enabled on that partition. Prevents spurious warning per-partition at shutdown. Notes: svn path=/head/; revision=61237
* Back out the previous change to the queue(3) interface.Jake Burkholder2000-05-267-33/+33
| | | | | | | | | It was not discussed and should probably not happen. Requested by: msmith and others Notes: svn path=/head/; revision=60938
* Change the way that the queue(3) structures are declared; don't assume thatJake Burkholder2000-05-237-33/+33
| | | | | | | | | | | the type argument to *_HEAD and *_ENTRY is a struct. Suggested by: phk Reviewed by: phk Approved by: mdodd Notes: svn path=/head/; revision=60833
* s/ffs_unmonut/ffs_unmount/ in a gratuitous ufs_extattr printf.Robert Watson2000-05-071-1/+1
| | | | | | | Reported by: knu Notes: svn path=/head/; revision=60165
* Separate the struct bio related stuff out of <sys/buf.h> intoPoul-Henning Kamp2000-05-0513-0/+13
| | | | | | | | | | | | | | | | | | <sys/bio.h>. <sys/bio.h> is now a prerequisite for <sys/buf.h> but it shall not be made a nested include according to bdes teachings on the subject of nested includes. Diskdrivers and similar stuff below specfs::strategy() should no longer need to include <sys/buf.> unless they need caching of data. Still a few bogus uses of struct buf to track down. Repocopy by: peter Notes: svn path=/head/; revision=60041
* Don't allow VOP_GETEXTATTR to set uio->uio_offset != 0, as we don'tRobert Watson2000-05-031-12/+10
| | | | | | | | | | | | | provide locking over extended attribute operations, requiring that individual operations be atomic. Allowing non-zero starting offsets permits applications/etc to put themselves at risk for inconsistent behavior. As VOP_SETEXTATTR already prohibited non-zero write offsets, this makes sense. Suggested by: Andreas Gruenbacher <a.gruenbacher@bestbits.at> Notes: svn path=/head/; revision=59913
* Remove unneeded #include <vm/vm_zone.h>Poul-Henning Kamp2000-04-303-3/+0
| | | | | | | Generated by: src/tools/tools/kerninclude Notes: svn path=/head/; revision=59794
* s/biowait/bufwait/gPoul-Henning Kamp2000-04-293-6/+6
| | | | | | | Prodded by: several. Notes: svn path=/head/; revision=59762
* Remove unneeded #include <sys/kernel.h>Poul-Henning Kamp2000-04-291-1/+0
| | | | Notes: svn path=/head/; revision=59760
* When files are given to users by root, the quota system failed toKirk McKusick2000-04-281-0/+10
| | | | | | | | | | | | | | | | | reset their grace timer as their ownership crossed the soft limit threshhold. Thus if they had been over their limit in the past, they were suddenly penalized as if they had been over their limit ever since. The fix is to check when root gives away files, that when the receiving user crosses their soft limit, their grace timer is reset. See the PR report for a detailed method of reproducing the bug. PR: kern/17128 Submitted by: Andre Albsmeier <andre.albsmeier@mchp.siemens.de> Reviewed by: Kirk McKusick <mckusick@mckusick.com> Notes: svn path=/head/; revision=59721
* Convert the magic MFS device to a VCHR.Poul-Henning Kamp2000-04-222-7/+5
| | | | | | | Detected by: obrien Notes: svn path=/head/; revision=59483
* o Introduce an extended attribute backing file header magic numberRobert Watson2000-04-192-3/+20
| | | | | | | o Introduce an extended attribute backing file header version number Notes: svn path=/head/; revision=59400
* Remove ~25 unneeded #include <sys/conf.h>Poul-Henning Kamp2000-04-193-3/+0
| | | | | | | Remove ~60 unneeded #include <sys/malloc.h> Notes: svn path=/head/; revision=59391
* o Cause attribute data writes to use IO_SYNC since this improves theRobert Watson2000-04-192-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | chances of consistency with other file/directory meta-data in a write. In the current set of extended attribute applications, this does not hurt much. This should be discussed again later when it comes time to optimize performance of attributes. o Include an inode generation number in the per-attribute header information. This allows consistency verification to catch when a crash occurs, or an inode is recycled while attributes are not properly configured. For now, an irritating error message is displayed when an inconsistency occurs. At some point, may introduce an ``extattrctl check ...'' which catches these before attributes are enabled. Not today. If you get this message, it means you somehow managed to get your attribute backing file out of synch with the file system. When this occurs, attribute not found is returned (== undefined). Writes will overwrite the value there correcting the problem. Might want to think about introducing a new errno or two to handle this kind of situation. Discussed with: kris Notes: svn path=/head/; revision=59388
* Retire bufqdisksort(), all drivers use bioqdisksort now.Poul-Henning Kamp2000-04-181-98/+0
| | | | Notes: svn path=/head/; revision=59363
* Remove unneeded cast.Jonathan Lemon2000-04-171-1/+1
| | | | Notes: svn path=/head/; revision=59308