summaryrefslogtreecommitdiffstats
path: root/sys/fs
Commit message (Collapse)AuthorAgeFilesLines
* Handle device drivers with D_NEEDGIANT in a way which does notphk2005-08-171-24/+0
| | | | | penalize the 'good' drivers: Allocate a shadow cdevsw and populate it with wrapper functions which grab Giant
* Collect the devfs related sysctls in one placephk2005-08-162-49/+34
|
* Create a new internal .h file to communicate very private stuffphk2005-08-162-0/+46
| | | | | | from kern_conf.c to devfs. For now just two prototypes, more to come.
* Eliminate effectively unused dm_basedir field from devfs_mount.phk2005-08-155-5/+3
|
* - restore the ability to mount cd9660 filesystems as root by invertinggrehan2005-08-141-7/+6
| | | | | | | | | | | | | | | | | | | | | | some of the options test, specifically the joliet and rockridge tests. Since the root mount callchain doesn't go through cd9660_cmount, the default mount options aren't set. Rather than having the main codepath assume the options are there, test for the absence of the inverted optioin e.g. instead of vfs_flagopt(.. "joliet" ..), test for !vfs_flagopt(.. "nojoliet" ..) This works for root mount, non-root mount and future nmount cases. - in cd9660_cmount, remove inadvertent setting of "gens" when "extatt" was set. Reported by: grehan, Dario Freni <saturnero at freesbie org> Tested by: Dario Freni Not objected to by: phk MFC after: 3 days
* Eliminate an unnecessary bcopy().des2005-08-121-15/+15
|
* Remove public declarations of variables that were forgotten when they wereobrien2005-08-101-1/+0
| | | | made static.
* Remove the need to forward declare statics by moving them around.obrien2005-08-101-15/+13
|
* Merge the dev_clone and dev_clone_cred event handlers into a singlerwatson2005-08-082-10/+8
| | | | | | | | | | | | | event handler, dev_clone, which accepts a credential argument. Implementors of the event can ignore it if they're not interested, and most do. This avoids having multiple event handler types and fall-back/precedence logic in devfs. This changes the kernel API for /dev cloning, and may affect third party packages containg cloning kernel modules. Requested by: phk MFC after: 3 days
* devfs is not yet fully MPSAFE - for example, multiple concurrent devfs(8)kris2005-07-291-1/+0
| | | | | | processes can cause a panic when operating on rulesets. Approved by: phk
* Correct devfs ruleset bypass.simon2005-07-201-0/+6
| | | | | | | Submitted by: csjp Reviewed by: phk Security: FreeBSD-SA-05:17.devfs Approved by: cperciva
* [1] unix2doschr()imura2005-07-171-10/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a character cannot be converted to DOS code page, unix2doschr() returned `0'. As a result, unix2dosfn() was forced to return `0', so we saw a file which was composed of these characters as `Invalid argument'. To correct this, if a character can be converted to Unicode, unix2doschr() now returns `1' which is a magic number to make unix2dosfn() know that the character must be converted to `_'. [2] unix2dosfn() The above-mentioned solution only works if a file has both of Unicode name and DOS code page name. Unicode name would not be recorded if file name can be settled within 11 bytes (DOS short name) and if no conversion from Unix charset to DOS code page has occurred. Thus, FreeBSD can create a file which has only short name, but there is no guarantee that the short name contains allways valid characters because we leave it to people by using mount_msdosfs(8) to select which conversion is used between DOS code page and unix charset. To avoid this, Unicode file name should be recorded unless a character is an ascii character. This is the way Windows XP do. PR: 77074 [1] MFC after: 1 week
* When devfs cloning takes place, provide access to the credential of therwatson2005-07-142-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | process that caused the clone event to take place for the device driver creating the device. This allows cloned device drivers to adapt the device node based on security aspects of the process, such as the uid, gid, and MAC label. - Add a cred reference to struct cdev, so that when a device node is instantiated as a vnode, the cloning credential can be exposed to MAC. - Add make_dev_cred(), a version of make_dev() that additionally accepts the credential to stick in the struct cdev. Implement it and make_dev() in terms of a back-end make_dev_credv(). - Add a new event handler, dev_clone_cred, which can be registered to receive the credential instead of dev_clone, if desired. - Modify the MAC entry point mac_create_devfs_device() to accept an optional credential pointer (may be NULL), so that MAC policies can inspect and act on the label or other elements of the credential when initializing the skeleton device protections. - Modify tty_pty.c to register clone_dev_cred and invoke make_dev_cred(), so that the pty clone credential is exposed to the MAC Framework. While currently primarily focussed on MAC policies, this change is also a prerequisite for changes to allow ptys to be instantiated with the UID of the process looking up the pty. This requires further changes to the pty driver -- in particular, to immediately recycle pty nodes on last close so that the credential-related state can be recreated on next lookup. Submitted by: Andrew Reisse <andrew.reisse@sparta.com> Obtained from: TrustedBSD Project Sponsored by: SPAWAR, SPARTA MFC after: 1 week MFC note: Merge to 6.x, but not 5.x for ABI reasons
* Regrab dvp only when ISDOTDOT.tanimura2005-07-091-1/+2
| | | | Approved by: re (scottl)
* - Since we don't hold a usecount in pfs_exit we have to get a holdcntjeff2005-07-071-0/+4
| | | | | | | prior to calling vgone() to prevent any races. Sponsored by: Isilon Systems, Inc. Approved by: re (vfs blanket)
* Jumbo-commit to enhance 32 bit application support on 64 bit kernels.peter2005-06-305-10/+199
| | | | | | | | | | | | | | | | | | | | | | | | This is good enough to be able to run a RELENG_4 gdb binary against a RELENG_4 application, along with various other tools (eg: 4.x gcore). We use this at work. ia32_reg.[ch]: handle the 32 bit register file format, used by ptrace, procfs and core dumps. procfs_*regs.c: vary the format of proc/XXX/*regs depending on the client and target application. procfs_map.c: Don't print a 64 bit value to 32 bit consumers, or their sscanf fails. They expect an unsigned long. imgact_elf.c: produce a valid 32 bit coredump for 32 bit apps. sys_process.c: handle 32 bit consumers debugging 32 bit targets. Note that 64 bit consumers can still debug 32 bit targets. IA64 has got stubs for ia32_reg.c. Known limitations: a 5.x/6.x gdb uses get/setcontext(), which isn't implemented in the 32/64 wrapper yet. We also make a tiny patch to gdb pacify it over conflicting formats of ld-elf.so.1. Approved by: re
* Conditionally weaken sys_generic.c rev 1.136 to allow certain dubiouspeter2005-06-301-0/+14
| | | | | | | | | | | | | ioctl numbers in backwards compatability mode. eg: an IOC_IN ioctl with a size of zero. Traditionally this was what you did before IOC_VOID existed, and we had some established users of this in the tree, namely procfs. Certain 3rd party drivers with binary userland components also have this too. This is necessary to have 4.x and 5.x binaries use these ioctl's. We found this at work when trying to run 4.x binaries. Approved by: re
* Avoid casting from (int *) to (size_t *) in order to fix udf_iconv on amd64.imura2005-06-051-4/+5
| | | | | Reviewed by: scottl MFC after: 2 weeks
* Do not declare a struct as extern, and then implementrodrigc2005-05-311-59/+57
| | | | | | | | it as static in the same file. This is not legal C, and GCC 4.0 will issue an error. Reviewed by: phk Approved by: das (mentor)
* Fix three typos in comments. Two of them obtained from OpenBSD.brueffer2005-05-111-3/+3
| | | | MFC after: 3 days
* Do not dereference dvp pointer before doing a NULL check.kan2005-05-111-1/+2
| | | | Noticed by: Coverity Prevent analysis tool.
* Staticize a symbol used only in this file.anholt2005-05-061-1/+1
| | | | | PR: kern/43613 Submitted by: Matt Emmerton, matt at gsicomp dot on dot ca
* The printf(9) `%p' conversion specifier puts an "0x" inrobert2005-05-061-2/+2
| | | | | front of the pointer value. Therefore, remove the "0x" from the format string.
* Fix our NTFS readdir function.robert2005-05-061-3/+3
| | | | | | | | | | | | | | | | | | | | | To check a directory's in-use bitmap bit by bit, we use a pointer to an 8 bit wide unsigned value. The index used to dereference this pointer is calculated by shifting the bit index right 3 bits. Then we do a logical AND with the bit# represented by the lower 3 bits of the bit index. This is an idiomatic way of iterating through a bit map with simple bitwise operations. This commit fixes the bug that we only checked bits 3:0 of each 8 bit chunk, because we only used bits 1:0 of the bit index for the bit# in the current 8 bit value. This resulted in files not being returned by getdirentries(2). Change the type of the bit map pointer from `char *' to `u_int8_t *'.
* Fix breakage on alpha.takawata2005-05-051-2/+2
| | | | Pointed out by: hrs via IRC
* Make smbfs capable to use 16bit char set in filenames.takawata2005-05-043-11/+31
| | | | PR:78110
* - Set the v_object pointer after a successful VOP_OPEN(). This isn't ajeff2005-05-031-1/+2
| | | | | | | perfect solution as the lower vm object can change at unpredictable times if our lower vp happens to be on another unionfs, etc. Submitted by: Oleg Sharoiko <os@rsu.ru>
* - In devfs_open() and devfs_close() grab Giant if the driver sets NEEDGIANT.jeff2005-05-011-5/+12
| | | | | We still have to DROP_GIANT and PICKUP_GIANT when NEEDGIANT is not set because vfs is still sometime entered with Giant held.
* Fix an old pasto.des2005-04-301-1/+1
|
* - Mark devfs as MNTK_MPSAFE as I belive it does not require Giant.jeff2005-04-301-0/+1
| | | | | Sponsored by: Isilon Systems, Inc. Agreed in principle by: phk
* - Fix several locking problems in unionfs_mount so that it will comejeff2005-04-271-23/+7
| | | | closer to passing DEBUG_VFS_LOCKS.
* - Pass the ISOPEN flag down to our lower filesystems.jeff2005-04-271-2/+1
| | | | - Remove an erroneous VOP lock assert.
* - As this is presently the one and only place where duplicate acquires ofjeff2005-04-221-1/+1
| | | | | | | the vnode interlock are allowed mark it by passing MTX_DUPOK to this lock operation only. Sponsored by: Isilon Systems, Inc.
* Disable negative name caching for msdosfs to work around a bug.das2005-04-161-0/+7
| | | | | | | | | | | | Since the name cache is case-sensitive and msdosfs isn't, creating a file 'foo' won't invalidate a negative entry for 'FOO'. There are similar problems related to 8.3 filenames. A better solution is to override VOP_LOOKUP with a method that canonicalizes the name, then calls vfs_cache_lookup(). Unfortunately, it's not quite that simple because vfs_cache_lookup() will call msdosfs_lookup() on a cache miss, and msdosfs_lookup() needs a way to get at the original component name.
* Fix mbnambuf support for multi-byte characters. If a substring is largernjl2005-04-161-19/+29
| | | | | | | | | | | than WIN_CHARS bytes, we shift the suffix (previous substrings) upwards by the amount this substring exceeds its WIN_CHARS slot. Profiling shows this change is indistinguishable from the previous code at 95% confidence. This bug would result in attempts to access or create files or directories with multi-byte characters returning an error but no data loss. Reported and tested by: avatar MFC after: 3 days
* Correct typo.brueffer2005-04-141-1/+1
| | | | Obtained from: OpenBSD
* - Change all filesystems and vfs_cache to relock the dvp once the child isjeff2005-04-1310-39/+17
| | | | | | locked in the ISDOTDOT case. Se vfs_lookup.c r1.79 for details. Sponsored by: Isilon Systems, Inc.
* - Clear VI_OWEINACT before calling vget() with no lock type. We knowjeff2005-04-111-0/+7
| | | | | the node is actually already locked, and VOP_INACTIVE is not desirable in this case.
* - Honor the flags argument passed to null_root(). The filesystem belowjeff2005-04-111-1/+1
| | | | us will decide whether or not to grab a real shared lock.
* Initialize vp before using it. Failing to do this can cause instantdelphij2005-04-101-0/+1
| | | | | | panic when trying to access a file on mounted smbfs. Submitted by: takawata at jp freebsd org
* Give msdosfs a unique inode number which is really the byteoffset ofphk2005-04-072-9/+26
| | | | | | | | the directory entry. This solves the corruption problem I belive. Regression test script by: silby
* - Fix union's assumptions about when the dvp is unlocked. It is onlyjeff2005-04-041-3/+3
| | | | unlocked in the ISDOTDOT case now, not for all !ISLASTCN lookups.
* Explicitly hold a reference to the cdev we have just cloned. Thisphk2005-03-312-0/+2
| | | | | closes the race where the cdev was reclaimed before it ever made it back to devfs lookup.
* cdev (still) needs per instance uid/gid/modephk2005-03-311-3/+3
| | | | | | Add unlocked version of dev_ref() Clean up various stuff in sys/conf.h
* Rename dev_ref() to dev_refl()phk2005-03-311-1/+1
|
* - LK_NOPAUSE is a nop now.jeff2005-03-311-1/+1
| | | | Sponsored by: Isilon Systems, Inc.
* - Remove wantparent, it is no longer necessary. An assert in vfs_lookup.cjeff2005-03-292-8/+6
| | | | | prevents any callers from doing a modifying op without LOCKPARENT or WANTPARENT.
* - Remove wantparent, it is no longer necessary. An assert in vfs_lookup.cjeff2005-03-291-7/+1
| | | | | prevents any callers from doing a DELETE or RENAME without locking the parent.
* - cache_lookup() now locks the new vnode for us to prevent some races.jeff2005-03-291-57/+37
| | | | | | Remove redundant code. Sponsored by: Isilon Systems, Inc.
* - Correct the dprintf format int the _lookup routine.jeff2005-03-282-2/+2
| | | | Spotted by: pjd
OpenPOWER on IntegriCloud