summaryrefslogtreecommitdiffstats
path: root/sys/ufs/ffs
Commit message (Collapse)AuthorAgeFilesLines
* Move vnode-to-file-handle translation from vfs_vptofh to vop_vptofh method.pjd2007-02-152-22/+28
| | | | | | | | | | | | | | | | This way we may support multiple structures in v_data vnode field within one file system without using black magic. Vnode-to-file-handle should be VOP in the first place, but was made VFS operation to keep interface as compatible as possible with SUN's VFS. BTW. Now Solaris also implements vnode-to-file-handle as VOP operation. VFS_VPTOFH() was left for API backward compatibility, but is marked for removal before 8.0-RELEASE. Approved by: mckusick Discussed with: many (on IRC) Tested with: ufs, msdosfs, cd9660, nullfs and zfs
* Call pbgetvp() and pbrelvp() instead of setting b_vp directly.tegge2007-02-041-3/+9
| | | | PR: kern/108151
* Cylinder group bitmaps and blocks containing inode for a snapshotkib2007-01-233-0/+120
| | | | | | | | | | | | | | | | | | | | | file are after snaplock, while other ffs device buffers are before snaplock in global lock order. By itself, this could cause deadlock when bdwrite() tries to flush dirty buffers on snapshotted ffs. If, during the flush, COW activity for snapshot needs to allocate block and ffs_alloccg() selects the cylinder group that is being written by bdwrite(), then kernel would panic due to recursive buffer lock acquision. Avoid dealing with buffers in bdwrite() that are from other side of snaplock divisor in the lock order then the buffer being written. Add new BOP, bop_bdwrite(), to do dirty buffer flushing for same vnode in the bdwrite(). Default implementation, bufbdflush(), refactors the code from bdwrite(). For ffs device buffers, specialized implementation is used. Reviewed by: tegge, jeff, Russell Cattelan (cattelan xfs org, xfs changes) Tested by: Peter Holm X-MFC after: 3 weeks (if ever: it changes ABI)
* Quota system cleanup.mpp2007-01-202-14/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1) Do not do quota accounting for the actual quota data files or for file system snapshot files ("system" files). This prevents a deadlock descibed in PR kern/30958 if the kernel ever has to grow the quota file. Snapshot files were already exempt from the quota checks, but this change generalized the check. 2) Fix a cast that caused extremely large uids/gids to incorrectly write the quota information to the data file at a truncated value for a uint_t32 id value. The incorrect cast caused quota files in this case to be around 4GB in size, with the correct cast they can now be 131GB in size. Also related to PR kern/30958. 3) Check for what appear to be negative UIDs/GIDs and not account for them. This prevents the quota files from becoming 131GB in size and causing quotacheck to run forever at bootup. This could also cause the kernel to try and expand the quota file, which might deadlock due to the issue in #1. kern/30958 and kern/38156 (and some much older closed PR's). 4) With the deadlock problems gone, the kernel can now expand the size of the quota database files if it needs to. 5) Pass in the i-node count change value to chkiq and chkiqchg as an int, like it used to be before the common routine was split up into 2 different routines to increase / decrease the i-node in-use count. Prevents an underflow on the i-node count. Related to PR kern/89247. 6) Prevent the block usage from growing slowly if a file system is full and the write was denied due to that fact. PR kern/89247. Some of these changes require an updated quotacheck to prevent the creation of huge (131GB) quota data files (item #3). #1/#4 probably fixes a lot of the random hangs when quotas are enabled, possibly some of the jail hangs.
* Fix a spelling error in some comments. heirarchy -> hierarchy.mpp2007-01-161-2/+2
| | | | Obtained from: OpenBSD
* change vop_lock handling to allowing tracking of callers' file and line forkmacy2006-11-131-9/+11
| | | | | | acquisition of lockmgr locks Approved by: scottl (standing in for mentor rwatson)
* Sweep kernel replacing suser(9) calls with priv(9) calls, assigningrwatson2006-11-063-19/+25
| | | | | | | | | | | | | specific privilege names to a broad range of privileges. These may require some future tweaking. Sponsored by: nCircle Network Security, Inc. Obtained from: TrustedBSD Project Discussed on: arch@ Reviewed (at least in part) by: mlaier, jmg, pjd, bde, ceri, Alex Lyashkov <umka at sevcity dot net>, Skip Ford <skip dot ford at verizon dot net>, Antoine Brodin <antoine dot brodin at laposte dot net>
* Aquire Giant in the softdep_flush for clear_remove() and clear_inodedeps()kib2006-11-011-0/+7
| | | | | | | | processing when QUOTA is set. Reported and tested by: Peter Holm Reviewed by: tegge MFC after: 3 days
* Add gjournal specific code to the UFS file system:pjd2006-10-313-4/+45
| | | | | | | | | | | | | | | | - Add FS_GJOURNAL flag which enables gjournal support on a file system. - Add cg_unrefs field to the cylinder group structure which holds number of unreferenced (orphaned) inodes in the given cylinder group. - Add fs_unrefs field to the super block structure which holds total number of unreferenced (orphaned) inodes. - When file or a directory is orphaned (last reference is removed, but object is still open), increase fs_unrefs and cg_unrefs fields, which is a hint for fsck in which cylinder groups looks for such (orphaned) objects. - When file is last closed, decrease {fs,cg}_unrefs fields. - Add VV_DELETED vnode flag which points at orphaned objects. Sponsored by: home.pl
* Complete break-out of sys/sys/mac.h into sys/security/mac/mac_framework.hrwatson2006-10-221-1/+2
| | | | | | | | | | | | | begun with a repo-copy of mac.h to mac_framework.h. sys/mac.h now contains the userspace and user<->kernel API and definitions, with all in-kernel interfaces moved to mac_framework.h, which is now included across most of the kernel instead. This change is the first step in a larger cleanup and sweep of MAC Framework interfaces in the kernel, and will not be MFC'd. Obtained from: TrustedBSD Project Sponsored by: SPARTA
* Do not translate the IN_ACCESS inode flag into the IN_MODIFIED while filesystemkib2006-10-103-13/+33
| | | | | | | | | | | | | | | is suspending/suspended. Doing so may result in deadlock. Instead, set the (new) IN_LAZYACCESS flag, that becomes IN_MODIFIED when suspend is lifted. Change the locking protocol in order to set the IN_ACCESS and timestamps without upgrading shared vnode lock to exclusive (see comments in the inode.h). Before that, inode was modified while holding only shared lock. Tested by: Peter Holm Reviewed by: tegge, bde Approved by: pjd (mentor) MFC after: 3 weeks
* Protect change to bo_flag by holding the bufobj mutex.tegge2006-09-261-0/+2
|
* Reduce fluctuations of mnt_flag to allow unlocked readers to get ategge2006-09-261-2/+1
| | | | slightly more consistent view.
* Don't restore MNT_QUOTA bit in mnt_flag after snapshot creation,tegge2006-09-261-1/+1
| | | | closing a race between nmount() and quotactl().
* Increase mnt_noasync once in softdep_mount() to disallow async io,tegge2006-09-261-0/+5
| | | | | | | closing a window where a file system using softupdates could be async for a short while if both MNT_UPDATE and MNT_ASYNC were passed as flags to nmount(). Add MNTK_SOFTDEP flag to ensure that softdep_mount() doesn't increase mnt_noasync multiple times.
* Use mount interlock to protect all changes to mnt_flag and mnt_kern_flag.tegge2006-09-263-14/+51
| | | | | This eliminates a race where MNT_UPDATE flag could be lost when nmount() raced against sync(), sync_fsync() or quotactl().
* Fix the glitch introduced in rev. 1.93. In softdep_sync_metadata(),kib2006-09-201-2/+3
| | | | | | | | | | | | switch by worklist type contains two for() loops, for D_INDIRDEP and D_PAGEDEP. On error, these loops are exited by break, where the switch actually shall be leaved. Use goto instead of break to reach the error handling code. Reported by: Peter Holm Reviewed by: tegge Approved by: pjd (mentor) MFC after: 2 weeks
* While checking for update of snapshot file in the ffs_copyonwrite,kib2006-08-211-1/+1
| | | | | | | | | | | first filter out metadata update. Otherwise, devfs vnode could be erronously interpreted as ufs one, causing further check of i_flags to use random memory. PR: kern/100365 Debugged and fix described by: tegge Approved by: pjd (mentor) MFC after: 2 weeks
* Drop two unnecessary casts.stefanf2006-07-181-2/+2
|
* Declare UFS module version.pjd2006-07-091-0/+1
|
* Change fs->fs_fsmnt to mp->mnt_stat.f_mntonname in warnings about missingpjd2006-07-091-2/+2
| | | | | | | MAC and ACLs support in the kernel. If it is a first mount, fs->fs_fsmnt is empty. MFC after: 1 week
* Check the sectorsize of the underlying disk before trying torodrigc2006-06-031-1/+8
| | | | | | | | | bread() the UFS superblock. Should eliminate crashes when trying to do: mount -t ufs on an audio CD. PR: kern/85893 Reported by: Russell Francis <rfrancis at ev dot net> MFC after: 1 week
* Remove "update" from ffs_opts. It has been moved to global_optsrodrigc2006-05-261-4/+1
| | | | in vfs_mount.c.
* Remove calls to vfs_export() for exporting a filesystem for NFS mountingrodrigc2006-05-261-18/+0
| | | | | from individual filesystems. Call it instead in vfs_mount.c, after we call VFS_MOUNT() for a specific filesystem.
* Take errmsg out of ffs_opts. It is already part of global_optsrodrigc2006-05-241-1/+1
| | | | in vfs_mount.c.
* Provide a less cryptic panic message in place of just "found inode."trhodes2006-05-161-1/+2
|
* Read block hints list from last snapshot on the active snapshot list.tegge2006-05-161-0/+4
|
* Copy last block on file system again after file system has been suspended.tegge2006-05-151-0/+11
| | | | Obtained from: NetBSD
* Don't leak a locked buffer if last block on file system cannot be read.tegge2006-05-151-2/+3
|
* Errors detected while file system is suspended should not trigger antegge2006-05-151-6/+4
| | | | assertion failure.
* Expunge traces of unlinked snapshot files when making a new snapshot.tegge2006-05-131-2/+9
|
* ffs_syncvnode() might skip some of the blocks due to them being locked,tegge2006-05-061-0/+46
| | | | | | | | | | | | assuming them to be inflight write buffers. This is not always the case. bufdaemon might hold the buffer lock and give up writing the buffer due to it having dependencies, the file system being suspended or the vnode lock being held by another thread. When bufdaemon decides to write the buffer there is still a window before bufobj_wref() has been called, allowing other threads to believe that the vnode has no dirty buffers or inflight writes. Try harder to flush first block of new subdirectory to get rid of MKDIR_BODY dependency.
* Return error if vnode was reclaimed while it was temporarily unlocked.tegge2006-05-051-1/+11
| | | | Add missing calls to vn_finished_write() in error handling.
* Turn off disk quotas for snapshot files.tegge2006-05-051-0/+21
|
* Avoid locking overhead when snapshots are disabled.tegge2006-05-051-0/+4
|
* - Set bio_done directly to NULL to indicate that we want to wait for the bio.pjd2006-05-051-5/+2
| | | | | | - Use biowait() instead of copying the code. MFC after: 1 month
* Detect the snapshot file being prematurely unlinked.tegge2006-05-031-0/+10
|
* Temporarily undo clusters contribution to global runningbufspace whiletegge2006-05-031-0/+4
| | | | handling copy on write for the buffers taking part in the cluster.
* A side effect of calling runningbufwakeup() is that bp->b_runningbufspace istegge2006-05-031-3/+10
| | | | | cleared. Save old value and restore bp->b_runningbufspace before returning from ffs_copyonwrite().
* Close a race when VOP_LOCK() on a snapshot file is attempted at thetegge2006-05-022-42/+110
| | | | | | same time as it is changed back into a normal file. The locker would get the shared "snaplk" lock which would no longer be the correct lock for the vnode.
* Fix a typo.scottl2006-04-281-1/+1
|
* - Add a BO_NEEDSGIANT flag to the bufobj. This flag forces all childjeff2006-04-281-1/+7
| | | | | | buffers to go on the buf daemon's DIRTYGIANT queue. - Set BO_NEEDSGIANT on ffs's devvp since the ffs_copyonwrite handler runs in the context of the buf daemon and may require Giant.
* Revert previous to this file before an actual request is made.trhodes2006-04-221-0/+12
|
* Remove what I believe are two useless ifdefs. If a user or administratortrhodes2006-04-211-12/+0
| | | | | | | | | | enables multilabel, or any option for that matter, most likely they have a reason. This will allow users to see that mulilabel is enabled via an issued "mount" command and remove an annoying warning - printed only when a MAC kernel is not installed - on boot up. Discussed with: green, brueffer, Samy Al Bahra. Probably ran past: csjp (though I can't remember).
* Fix panic() message to give the right function name.kensmith2006-04-171-1/+1
|
* Eliminate softdep_flush() livelock by accounting for number of worklist itemstegge2006-04-031-1/+6
| | | | marked as being in progress.
* - Release the references acquired by VOP_GETWRITEMOUNT and vfs_getvfs().jeff2006-03-312-1/+7
| | | | | | Discussed with: tegge Tested by: kris Sponsored by: Isilon Systems, Inc.
* Allow compilation when not using softupdates.tegge2006-03-191-2/+0
|
* Let snapshots make a copy of old contents for all buffers taking part in ategge2006-03-191-11/+38
| | | | | | | | cluster instead of just the first buffer. Delay buf_start() calls until snapshots have a copy of old content. PR: kern/93942
* Reduce probability of unmount failing after having unmounted snapshots.tegge2006-03-191-0/+1
|
OpenPOWER on IntegriCloud