summaryrefslogtreecommitdiffstats
path: root/sys/fs
Commit message (Collapse)AuthorAgeFilesLines
* Do not attempt to open NODEVphk2004-02-241-0/+3
|
* Fix comment containing vop_readdir_args contents: a_cookies is reallytjr2004-02-231-1/+1
| | | | u_long ** not u_long *.
* cookies is an array of u_long, not u_int, so MALLOC() it accordingly.tjr2004-02-231-2/+2
| | | | | Allocating it with the wrong size could have caused corruption on 64-bit architectures.
* Fixed a serious off by 1 error. The cluster-in-use bitmap was overrunbde2004-02-211-2/+1
| | | | | | | by 1 u_int if the number of clusters was 1 more than a multiple of (8 * sizeof(u_int)). The bitmap is malloced and large (often huge), so fatal overrun probably only occurred if the number of clusters was 1 more than 1 multiple of PAGE_SIZE/8.
* Device megapatch 6/6:phk2004-02-211-9/+30
| | | | | | | | | | | | | | | | | | | | | | | | | This is what we came here for: Hang dev_t's from their cdevsw, refcount cdevsw and dev_t and generally keep track of things a lot better than we used to: Hold a cdevsw reference around all entrances into the device driver, this will be necessary to safely determine when we can unload driver code. Hold a dev_t reference while the device is open. KASSERT that we do not enter the driver on a non-referenced dev_t. Remove old D_NAG code, anonymous dev_t's are not a problem now. When destroy_dev() is called on a referenced dev_t, move it to dead_cdevsw's list. When the refcount drops, free it. Check that cdevsw->d_version is correct. If not, set all methods to the dead_*() methods to prevent entrance into driver. Print warning on console to this effect. The device driver may still explode if it is also incompatible with newbus, but in that case we probably didn't get this far in the first place.
* Device megapatch 5/6:phk2004-02-211-2/+1
| | | | | | | | | | | | Remove the unused second argument from udev2dev(). Convert all remaining users of makedev() to use udev2dev(). The semantic difference is that udev2dev() will only locate a pre-existing dev_t, it will not line makedev() create a new one. Apart from the tiny well controlled windown in D_PSEUDO drivers, there should no longer be any "anonymous" dev_t's in the system now, only dev_t's created with make_dev() and make_dev_alias()
* Device megapatch 4/6:phk2004-02-212-8/+10
| | | | | | | | Introduce d_version field in struct cdevsw, this must always be initialized to D_VERSION. Flip sense of D_NOGIANT flag to D_NEEDGIANT, this involves removing four D_NOGIANT flags and adding 145 D_NEEDGIANT flags.
* Report the correct length for symlink entries.phk2004-02-191-1/+1
|
* Use size_t or ssize_t wherever appropriate instead of casting from int *tjr2004-02-192-26/+27
| | | | | | | to size_t *, which is incorrect because they may have different widths. This caused some subtle forms of corruption, the mostly frequently reported one being that the last character of a filename was sometimes duplicated on amd64.
* Do not place dirmask in unnamed padding. Move it to the bottom of thistrhodes2004-02-171-1/+1
| | | | | | list where it should have been added originally. Prodded by: bde
* If the "next free cluster" field of the FSInfo block is 0xFFFFFFFF,tjr2004-02-171-2/+4
| | | | | | | | | | it means that the correct value is unknown. Since this value is just a hint to improve performance, initially assume that the first non-reserved cluster is free, then correct this assumption if necessary before writing the FSInfo block back to disk. PR: 62826 MFC after: 2 weeks
* White-space align a struct definition.phk2004-02-153-37/+27
| | | | Move a SYSINIT to the file where it belongs.
* Fixed some style bugs:bde2004-02-141-4/+4
| | | | | | - don't unlock the vnode after vinvalbuf() only to have to relock it almost immediately. - don't refer to devices classified by vn_isdisk() as block devices.
* MFffs (ffs_vfsops.c 1.227: clean up open mode bandaid). This reducesbde2004-02-121-11/+12
| | | | gratuitous differences with ffs a little.
* Fix a panic in pseudofs(9) that could occur when doing an I/Onectar2004-02-101-0/+5
| | | | | | | operation with a large request or large offset. Reported by: Joel Ray Holveck <joelh@piquan.org> Submitted by: des
* Fixes problems that occurred when a file was removed and a directorytjr2004-02-103-1/+42
| | | | | | | | | | | | | | | | created with the same name, and vice versa: - Immediately recycle vnodes of files & directories that have been deleted or renamed. - When looking an entry in the VFS name cache or smbfs's private cache, make sure the vnode type is consistent with the type of file the server thinks it is, and re-create the vnode if it isn't. The alternative to this is to recycle vnodes unconditionally when their use count drops to 0, but this would make all the caching we do mostly useless. PR: 62342 MFC after: 2 weeks
* Locking for the per-process resource limits structure.jhb2004-02-045-19/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - struct plimit includes a mutex to protect a reference count. The plimit structure is treated similarly to struct ucred in that is is always copy on write, so having a reference to a structure is sufficient to read from it without needing a further lock. - The proc lock protects the p_limit pointer and must be held while reading limits from a process to keep the limit structure from changing out from under you while reading from it. - Various global limits that are ints are not protected by a lock since int writes are atomic on all the archs we support and thus a lock wouldn't buy us anything. - All accesses to individual resource limits from a process are abstracted behind a simple lim_rlimit(), lim_max(), and lim_cur() API that return either an rlimit, or the current or max individual limit of the specified resource from a process. - dosetrlimit() was renamed to kern_setrlimit() to match existing style of other similar syscall helper functions. - The alpha OSF/1 compat layer no longer calls getrlimit() and setrlimit() (it didn't used the stackgap when it should have) but uses lim_rlimit() and kern_setrlimit() instead. - The svr4 compat no longer uses the stackgap for resource limits calls, but uses lim_rlimit() and kern_setrlimit() instead. - The ibcs2 compat no longer uses the stackgap for resource limits. It also no longer uses the stackgap for accessing sysctl's for the ibcs2_sysconf() syscall but uses kernel_sysctl() instead. As a result, ibcs2_sysconf() no longer needs Giant. - The p_rlimit macro no longer exists. Submitted by: mtm (mostly, I only did a few cleanups and catchups) Tested on: i386 Compiled on: alpha, amd64
* Fix style(9) of my previous commit.cperciva2004-01-211-1/+1
| | | | | Noticed by: nate Approved by: nate, rwatson (mentor)
* Allow devfs path rules to work on directories. Without this fix,cperciva2004-01-211-1/+2
| | | | | | | | devfs rule add path fd unhide is a no-op, while it should unhide the fd subdirectory. Approved by: phk, rwatson (mentor) PR: kern/60897
* Spell magic '16' number as IO_SEQSHIFT.kan2004-01-191-1/+1
|
* Do not allow operations which cause known file-system corruption.green2004-01-161-2/+8
|
* Remove a warning.green2004-01-161-2/+0
|
* Fix an upper-vnode leak created in revision 1.52. When an upper-layergreen2004-01-162-19/+13
| | | | | | | | | | | | file has been removed, it should be purged from the cache, but it need not be removed from the directory stack causing corruption; instead, it will simply be removed once the last references and holds on it are dropped at the end of the unlink/rmdir system calls, and the normal !UN_CACHED VOP_INACTIVE() handler for unionfs finishes it off. This is easily reproduced by repeated "echo >file; rm file" on a unionfs mount. Strangely, "echo -n >file; rm file" didn't make it happen.
* Fix an inverted test for NOPEN in the unused function smb_smb_flush().tjr2004-01-121-1/+1
|
* Don't try to unlock the directory vnode in null_lookup() if the lock istruckman2004-01-111-1/+1
| | | | | shared with the underlying file system and the lookup in the underlying file system did the unlock for us.
* Restore closing of SMB find handle in smbfs_close().tjr2004-01-101-1/+8
|
* Lock p->p_textvp before calling vn_fullpath() on it. Note therwatson2004-01-071-0/+2
| | | | | | | | potential lock order concern due to the vnode lock held simultaneously by the caller into procfs. Reported by: kuriyama Approved by: des
* In smbfs_inactive(), only invalidate the node's attribute cache if wetjr2004-01-041-1/+1
| | | | had to send a file close request to the server.
* Pass ACL, extended attribute and MAC vnode ops down the vnode stack.tjr2004-01-031-0/+239
|
* Improve on POLA by populating DEVFS before doing devfs(8) rule ioctls.phk2004-01-021-0/+5
| | | | | PR: 60687 Spotted by: Colin Percival <cperciva@daemonology.net>
* Fixed some (most) style bugs in rev.1.33. Mainly 4-char indentationbde2003-12-291-58/+68
| | | | | | (msdosfs uses normal 8-char indentation almost everywhere else), too-long lines, and minor English usage errors. The verbose formal comment before the new function is still abnormal.
* Fixed some minor style bugs in rev.1.144. All related to msdosfs_advlock()bde2003-12-291-11/+8
| | | | | | | (mainly unsorting). There were no changes related to the dirty flag here. The reference NetBSD implementation put msdosfs_advlock() in a different place. This commit only moves its declarations and changes some of the function body to be like the NetBSD version.
* Fixed style bugs in rev.1.112. The bugs started with obscure magicbde2003-12-291-12/+12
| | | | numbers in comments (Apple PR numbers?) and didn't improve.
* v_vxproc was a bogus name for a thread (pointer).bde2003-12-281-2/+2
|
* Make msdosfs support the dirty flag in FAT16 and FAT32.trhodes2003-12-265-1/+106
| | | | | | | | Enable lockf support. PR: 55861 Submitted by: Jun Su <junsu@m-net.arbornet.org> (original version) Reviewed by: make universe
* Make oldsize in smbfs_getattr() 64 bits wide instead of 32 to avoidtjr2003-12-221-1/+1
| | | | truncation when files are larger than 4GB.
* Avoid sign extension when casting signed characters to unsigned widetjr2003-12-161-2/+2
| | | | | characters in ntfs_u28(). This fixes the conversion of filenames containing single-byte characters with the high bit set.
* Make msdosfs long filenames matching case insensitive again.fjoe2003-12-081-3/+5
| | | | | PR: 59765 Submitted by: Ryuichiro Imura <imura@ryu16.org>
* Constify, and add an API function to find a named node in a directory.des2003-12-072-6/+21
|
* Minor whitespace and style issues.des2003-12-077-21/+16
|
* Remove useless SMP check code.des2003-12-072-22/+0
|
* Re-arrange and consolidate some random debugging stuffscottl2003-12-071-20/+1
|
* Fix vnode locking in fdesc_setattr. Lock vnode before invokingkan2003-11-191-5/+5
| | | | | | VOP_SETATTR on it. Approved by: re@ (rwatson)
* Use "fip->fi_readers == 0 && fip->fi_writers == 0" as the condition fortruckman2003-11-161-6/+3
| | | | | | | | | | disposing fifo resources in fifo_cleanup() instead using of "vp->v_usecount == 1". There may be other references to the vnode, for instance by nullfs, at the time fifo_open() or fifo_close() is called, which could cause a resource leak. Don't bother grabbing the vnode interlock in fifo_cleanup() since it no longer accesses v_usecount.
* - A sanity check in unionfs verifies that lookups of '.' return thedas2003-11-141-27/+21
| | | | | | | | | | | | | vnode of the parent. However, this check should not be performed if the lookup failed. This change should fix "union_lookup returning . not same as startdir" panics people were seeing. The bug was introduced by an incomplete import of a NetBSD delta in rev 1.38. - Move the aforementioned check out from DIAGNOSTIC. Performance is the least of our unionfs worries. - Minor reorganization. PR: 53004 MFC after: 1 week
* Initialize b_iooffset correctly.phk2003-11-131-0/+1
|
* Don't mess around with spare fields of public structures.phk2003-11-121-1/+0
|
* Don't mess about with spare fields in public structures.phk2003-11-121-1/+0
|
* Modify the MAC Framework so that instead of embedding a (struct label)rwatson2003-11-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | in various kernel objects to represent security data, we embed a (struct label *) pointer, which now references labels allocated using a UMA zone (mac_label.c). This allows the size and shape of struct label to be varied without changing the size and shape of these kernel objects, which become part of the frozen ABI with 5-STABLE. This opens the door for boot-time selection of the number of label slots, and hence changes to the bound on the number of simultaneous labeled policies at boot-time instead of compile-time. This also makes it easier to embed label references in new objects as required for locking/caching with fine-grained network stack locking, such as inpcb structures. This change also moves us further in the direction of hiding the structure of kernel objects from MAC policy modules, not to mention dramatically reducing the number of '&' symbols appearing in both the MAC Framework and MAC policy modules, and improving readability. While this results in minimal performance change with MAC enabled, it will observably shrink the size of a number of critical kernel data structures for the !MAC case, and should have a small (but measurable) performance benefit (i.e., struct vnode, struct socket) do to memory conservation and reduced cost of zeroing memory. NOTE: Users of MAC must recompile their kernel and all MAC modules as a result of this change. Because this is an API change, third party MAC modules will also need to be updated to make less use of the '&' symbol. Suggestions from: bmilekic Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories
* If fifo_open() is interrupted, fifo_close() may not get called, causingtruckman2003-11-101-9/+23
| | | | | | | | | a resource leak. Move the resource deallocation code from fifo_close() to a new function, fifo_cleanup(), and call fifo_cleanup() from fifo_close() and the appropriate places in fifo_open(). Tested by: Lukas Ertl Pointy hat to: truckman
OpenPOWER on IntegriCloud