summaryrefslogtreecommitdiffstats
path: root/sys/fs
Commit message (Collapse)AuthorAgeFilesLines
* Convert nullfs hash lock from a mutex to an rwlock.mjg2014-12-301-12/+12
|
* r245508 modified the NFS client's Setattr RPC tormacklem2014-12-281-1/+8
| | | | | | | | | | | | | | | | | | | | | use VA_UTIMES_NULL to indicate whether it should set the time to the current tod on the server. This had the side effect of making the NFS client use the client's timestamp for exclusive create, starting with FreeBSD9.2. Unfortunately a bug in some Solaris NFS servers causes these servers to return NFS_OK to the Setattr RPC done during exclusive create, but not actually set the file's mode, leaving the file's mode == 0. This patch restores the NFS client's behaviour to use the server's tod for the exclusive open's Setattr RPC, to avoid the Solaris server bug and to restore the pre-FreeBSD9.2 NFS behaviour. Discussed on: freebsd-fs PR: 186293 MFC after: 3 months
* Delete some duplicate code that was harmless becausermacklem2014-12-251-14/+0
| | | | | | | | exactly the same code is at the end of the nfscl_checksattr() function that is called just before it. As such, this code had already been executed and didn't do anything. MFC after: 1 week
* A deadlock in the NFSv4 server with vfs.nfsd.enable_locallocks=1rmacklem2014-12-252-33/+101
| | | | | | | | | | | | | | | | was reported via email. This was caused by a LOR between the sleep lock used to serialize the local locking (nfsrv_locklf()) and locking the vnode. I believe this patch fixes the problem by delaying relocking of the vnode until the sleep lock is unlocked (nfsrv_unlocklf()). To avoid nfsvno_advlock() having the side effect of unlocking the vnode, unlocking the vnode was moved to before the functions that call nfsvno_advlock(). It shouldn't affect the execution of the default case where vfs.nfsd.enable_locallocks=0. Reported by: loic.blot@unix-experience.fr Discussed with: kib MFC after: 1 week
* Fix kernel builds with "options NFS_DEBUG" thatrmacklem2014-12-233-18/+23
| | | | | | | | were broken by r276096. Also delete the two kernel options NFS_GATHERDELAY, NFS_WDELAYHASHSIZ which are no longer used. Reported by: bz
* Remove the old NFS client and server from head,rmacklem2014-12-234-8/+8
| | | | | | | | | | | | which means that the NFSCLIENT and NFSSERVER kernel options will no longer work. This commit only removes the kernel components. Removal of unused code in the user utilities will be done later. This commit does not include an addition to UPDATING, but that will be committed in a few minutes. Discussed on: freebsd-fs
* Handle MAKEENTRY cnp flag in the VOP_CREATE(). Curiously, somekib2014-12-214-2/+12
| | | | | | | | fs, e.g. smbfs, already did it. Tested by: pho (previous version) Sponsored by: The FreeBSD Foundation MFC after: 2 weeks
* Adjust the test of a KASSERT to better match the intent.benno2014-12-191-1/+2
| | | | | | | | | | This assertion was added in r246213 as a guard against corrupted mbufs arriving from drivers, the key distinguishing factor of said mbufs being that they had a negative length. Given we're in a while loop specifically designed to skip over zero-length mbufs, panicking on a zero-length mbuf seems incorrect. No objection from: kib
* The VOP_LOOKUP() implementations for CREATE op do not put the namekib2014-12-189-16/+16
| | | | | | | | | | | | | | | | | | | | | | into namecache, to avoid cache trashing when doing large operations. E.g., tar archive extraction is not usually followed by access to many of the files created. Right now, each VOP_LOOKUP() implementation explicitely knowns about this quirk and tests for both MAKEENTRY flag presence and op != CREATE to make the call to cache_enter(). Centralize the handling of the quirk into VFS, by deciding to cache only by MAKEENTRY flag in VOP. VFS now sets NOCACHE flag for CREATE namei() calls. Note that the change in semantic is backward-compatible and could be merged to the stable branch, and is compatible with non-changed third-party filesystems which correctly handle MAKEENTRY. Suggested by: Chris Torek <torek@pi-coral.com> Reviewed by: mckusick Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks
* Adjust printf format specifiers for dev_t and ino_t in kernel.gleb2014-12-173-9/+11
| | | | | | ino_t and dev_t are about to become uint64_t. Reviewed by: kib, mckusick
* ext2fs: Fix old out-of-bounds access.pfg2014-12-091-6/+16
| | | | | | | | | | | | | | Overrunning buffer pointed to by (caddr_t)&oip->i_db[0] of 48 bytes by passing it to a function which accesses it at byte offset 59 using argument 60UL. The issue was inherited from an older FFS implementation and fixed there with by merging UFS2 in r98542. We follow the FFS fix. Discussed with: bde CID: 1007665 MFC after: 3 days
* Do not call VFS_SYNC() before VFS_UNMOUNT() for forced unmount.kib2014-12-091-3/+7
| | | | | | | | | | | | | | | | | | Since VFS does not/cannot stop writes, sync might run indefinitely, or be a wrong thing to do at all. E. g. NFS ignores VFS_SYNC() for forced unmounts, since non-responding server does not allow sync to finish. On the other hand, filesystems can and do stop writes using fs-specific facilities, and should already fully flush caches in VFS_UNMOUNT() due to the race. Adjust msdosfs tp sync in unmount for forced call, to accomodate the new behaviour. Note that it is still racy, since writes are not stopped. Discussed with: avg, bjk, mckusick Reported and tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 3 weeks
* The process spin lock currently has the following distinct uses:kib2014-11-261-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - Threads lifetime cycle, in particular, counting of the threads in the process, and interlocking with process mutex and thread lock. The main reason of this is that turnstile locks are after thread locks, so you e.g. cannot unlock blockable mutex (think process mutex) while owning thread lock. - Virtual and profiling itimers, since the timers activation is done from the clock interrupt context. Replace the p_slock by p_itimmtx and PROC_ITIMLOCK(). - Profiling code (profil(2)), for similar reason. Replace the p_slock by p_profmtx and PROC_PROFLOCK(). - Resource usage accounting. Need for the spinlock there is subtle, my understanding is that spinlock blocks context switching for the current thread, which prevents td_runtime and similar fields from changing (updates are done at the mi_switch()). Replace the p_slock by p_statmtx and PROC_STATLOCK(). The split is done mostly for code clarity, and should not affect scalability. Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week
* Implement "automount -c".trasz2014-11-223-1/+16
| | | | | MFC after: 1 month Sponsored by: The FreeBSD Foundation
* Fix smbfs to not zero out statfs f_flags field. Previously, thistrasz2014-11-211-2/+0
| | | | | | | | | | | | made getmntinfo() return empty flags for smbfs filesystems when called with MNT_WAIT. It's not visible with mount(8), since it uses MNT_NOWAIT, but broke autounmount(8) operation. PR: 195161 Differential Revision: https://reviews.freebsd.org/D1194 Reviewed by: kib@ MFC after: 1 month Sponsored by: The FreeBSD Foundation
* ifdef ext2_print_inode which is not really used.pfg2014-11-123-2/+6
| | | | | | | | | ext2_print_inode is not really used but it was nice to have for initial development work. #ifdef it under a new EXT2FS_DEBUG knob so that we don't spend time compiling it. MFC after: 3 days
* Fix up some session-related races in devfs.mjg2014-11-031-23/+42
| | | | | | One was introduced with r272596, the rest was there to begin with. Noted by: jhb
* Fix handling of "conn" mount_nfs(8) option.trasz2014-10-301-1/+1
| | | | | | Reviewed by: rmacklem@ MFC after: 1 month Sponsored by: The FreeBSD Foundation
* Add support for "timeo", "actimeo", "noac", and "proto" optionstrasz2014-10-301-6/+34
| | | | | | | | | to mount_nfs(8). They are implemented on Linux, OS X, and Solaris, and thus can be expected to appear in automounter maps. Reviewed by: rmacklem@ MFC after: 1 month Sponsored by: The FreeBSD Foundation
* Allow the vfs.nfsd knobs to be set from loader.conf (or usingkib2014-10-271-3/+3
| | | | | | | | kenv(8)). This is useful when nfsd is loaded as module. Reviewed by: rmacklem Sponsored by: The FreeBSD Foundation MFC after: 1 week
* Clip the settings for the NFS rsize, wsize mount optionsrmacklem2014-10-221-6/+16
| | | | | | | | | | to a power of 2. For non-power of 2 settings, intermittent page faults have been reported. Although the bug that causes these page faults/crashes has not been identified, it does not appear to occur when rsize, wsize is a power of 2. Reported by: tcberner@gmail.com MFC after: 2 weeks
* Revert r273481 so it can be recoded using fls(), whichrmacklem2014-10-221-27/+9
| | | | some feel will make it more readable.
* Clip the settings for the NFS rsize, wsize mount optionsrmacklem2014-10-221-9/+27
| | | | | | | | | | to a power of 2. For non-power of 2 settings, intermittent page faults have been reported. Although the bug that causes these page faults/crashes has not been identified, it does not appear to occur when rsize, wsize is a power of 2. Reported by: tcberner@gmail.com MFC after: 2 weeks
* tmpfs: allow shared file lookupsmjg2014-10-211-1/+1
| | | | Tested by: pho
* Fix multiple incorrect SYSCTL arguments in the kernel:hselasky2014-10-213-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - Wrong integer type was specified. - Wrong or missing "access" specifier. The "access" specifier sometimes included the SYSCTL type, which it should not, except for procedural SYSCTL nodes. - Logical OR where binary OR was expected. - Properly assert the "access" argument passed to all SYSCTL macros, using the CTASSERT macro. This applies to both static- and dynamically created SYSCTLs. - Properly assert the the data type for both static and dynamic SYSCTLs. In the case of static SYSCTLs we only assert that the data pointed to by the SYSCTL data pointer has the correct size, hence there is no easy way to assert types in the C language outside a C-function. - Rewrote some code which doesn't pass a constant "access" specifier when creating dynamic SYSCTL nodes, which is now a requirement. - Updated "EXAMPLES" section in SYSCTL manual page. MFC after: 3 days Sponsored by: Mellanox Technologies
* Provide vfs suspension support only for filesystems which need it, takemjg2014-10-203-9/+10
| | | | | | | | | | | | | two. nullfs and unionfs need to request suspension if underlying filesystem(s) use it. Utilize mnt_kern_flag for this purpose. This is a fixup for 273271. No strong objections from: kib Pointy hat to: mjg MFC after: 2 weeks
* unionfs: hold mount interlock while manipulating mnt_flagmjg2014-10-201-0/+2
| | | | This is for consistency with other filesystems.
* Provide vfs suspension support only for filesystems which need it.mjg2014-10-191-0/+9
| | | | | | | | Need is expressed by providing vfs_susp_clean function in vfsops. Differential Revision: D952 Reviewed by: kib (previous version) MFC after: 2 weeks
* Remove useless debug.trasz2014-10-171-1/+0
| | | | Sponsored by: The FreeBSD Foundation
* Make the sysctl(8) for checkutf8 positively defined and improvearaujo2014-10-171-5/+5
| | | | | | | | | the description of it. Submitted by: Ronald Klop <ronald-lists@klop.ws> Reviewed by: rmacklem Approved by: rmacklem Sponsored by: QNAP Systems Inc.
* Follow up to r225617. In order to maximize the re-usability of kernel codedavide2014-10-161-1/+1
| | | | | | | | in userland rename in-kernel getenv()/setenv() to kern_setenv()/kern_getenv(). This fixes a namespace collision with libc symbols. Submitted by: kmacy Tested by: make universe
* Add two sysctl(8) to enable/disable NFSv4 server to check when settingaraujo2014-10-161-2/+14
| | | | | | | | | | | | | | | user nobody and/or setting group nogroup as owner of a file or directory. Usually at the client side, if there is an username that is not in the client's passwd database, some clients will send 'nobody@<your.dns.domain>' in the wire and the NFSv4 server will treat it as an ERROR. However, if you have a valid user nobody in your passwd database, the NFSv4 server will treat it as a NFSERR_BADOWNER as its believes the client doesn't has the username mapped. Submitted by: Loic Blot <loic.blot@unix-experience.fr> Reviewed by: rmacklem Approved by: rmacklem MFC after: 2 weeks
* Style changes for deadfs:kib2014-10-151-54/+10
| | | | | | | | | | - ANSIfy VOPs. - Remove trivial comments. - Remove ARGSUSED. - Remove copies of the vop_XXX_args structure definitions in comments. Sponsored by: The FreeBSD Foundation MFC after: 1 week
* When vnode bypass cannot be performed on the cdev file descriptor forkib2014-10-152-13/+19
| | | | | | | | | | | | | | | read/write/poll/ioctl, call standard vnode filedescriptor fop. This restores the special handling for terminals by calling the deadfs VOP, instead of always returning ENXIO for destroyed devices or revoked terminals. Since destroyed (and not revoked) device would use devfs_specops VOP vector, make dead_read/write/poll non-static and fill VOP table with pointers to the functions, to instead of VOP_PANIC. Noted and reviewed by: bde Sponsored by: The FreeBSD Foundation MFC after: 1 week
* Change the deadfs poll VOP to return POLLIN|POLLRDNORM if the callerkib2014-10-151-6/+9
| | | | | | | | | | is interested in i/o state. Return POLLNVAL for invalid bits, similar to poll_no_poll(). Note that POLLOUT must not be returned, since POLLHUP is set. Noted and reviewed by: bde Sponsored by: The FreeBSD Foundation MFC after: 1 week
* Make automountd(8) inform autofs(4) whether directory being handled cantrasz2014-10-153-5/+20
| | | | | | | | | | | | have wildcards. This makes it possible for autofs(4) to avoid requesting automountd(8) action on access to nonexistent nodes - unless wildcards are actually used. Note that this change breaks ABI for automountd(8). Tested by: dhw@ MFC after: 1 month Sponsored by: The FreeBSD Foundation
* Do not set IN_ACCESS flag for read-only mounts. The IN_ACCESSkib2014-10-112-2/+2
| | | | | | | | | survives remount in rw, also it is set for vnodes on rootfs before noatime can be set or clock is adjusted. All conditions result in wrong atime for accessed vnodes. Submitted by: bde MFC after: 1 week
* Add assertion to catch duplicated notes.trasz2014-10-111-1/+5
| | | | Sponsored by: The FreeBSD Foundation
* Remove remnants of some cleanup; no functional changes.trasz2014-10-091-2/+2
| | | | Sponsored by: The FreeBSD Foundation
* Simplify; no functional changes.trasz2014-10-081-1/+1
| | | | | MFC after: 1 month Sponsored by: The FreeBSD Foundation
* devfs: tidy up after 272596mjg2014-10-061-3/+3
| | | | | | This moves a var to an if statement, no functional changes. MFC after: 1 week
* devfs: don't take proctree_lock unconditionally in devfs_closemjg2014-10-061-10/+13
| | | | MFC after: 1 week
* Make autofs use shared vnode locks.trasz2014-10-043-9/+16
| | | | | | Reviewed by: kib MFC after: 1 month Sponsored by: The FreeBSD Foundation
* Fix autofs debug macros.trasz2014-10-031-7/+10
| | | | | MFC after: 1 month Sponsored by: The FreeBSD Foundation
* Make autofs(4) use shared lock for lookups, instead of exclusive one.trasz2014-10-034-22/+25
| | | | | MFC after: 1 month Sponsored by: The FreeBSD Foundation
* Fix failures and warnings reported by newpynfs20090424 test tool.araujo2014-10-036-34/+89
| | | | | | | | | | | This fix addresses only issues with the pynfs reports, none of these issues are know to create problems for extant real clients. Submitted by: Bart Hsiao <bart.hsiao@gmail.com> Reworked by: myself Reviewed by: rmacklem Approved by: rmacklem Sponsored by: QNAP Systems Inc.
* Call uma_zfree() outside of lock, and improve comment.trasz2014-10-021-2/+2
| | | | Sponsored by: The FreeBSD Foundation
* Make autofs timeout handling use timeout task instead of callout;trasz2014-10-024-6/+15
| | | | | | | | that's because the handler can sleep on sx lock. Reviewed by: kib MFC after: 1 week Sponsored by: The FreeBSD Foundation
* Fix thinko that, with two map entries like shown below, in that order,trasz2014-09-231-0/+2
| | | | | | | | | | | made autofs mix them up: the second one wasn't visible in ls(1) output, and trying to access it would trigger mount for the first one. foobar host:/foobar foo host:/foo MFC after: 3 days Sponsored by: The FreeBSD Foundation
* Add a new fo_fill_kinfo fileops method to add type-specific information tojhb2014-09-221-0/+1
| | | | | | | | | | | | | | struct kinfo_file. - Move the various fill_*_info() methods out of kern_descrip.c and into the various file type implementations. - Rework the support for kinfo_ofile to generate a suitable kinfo_file object for each file and then convert that to a kinfo_ofile structure rather than keeping a second, different set of code that directly manipulates type-specific file information. - Remove the shm_path() and ksem_info() layering violations. Differential Revision: https://reviews.freebsd.org/D775 Reviewed by: kib, glebius (earlier version)
OpenPOWER on IntegriCloud