summaryrefslogtreecommitdiffstats
path: root/sys/fs
Commit message (Collapse)AuthorAgeFilesLines
* Mechanically substitute flags from historic mbuf allocator withglebius2012-12-056-12/+12
| | | | | | | | | malloc(9) flags within sys. Exceptions: - sys/contrib not touched - sys/mbuf.h edited manually
* Add an nfssvc() option to the kernel for the new NFS clientrmacklem2012-12-023-0/+128
| | | | | | | | which dumps out the actual options being used by an NFS mount. This will be used to implement a "-m" option for nfsstat(1). Reviewed by: alfred MFC after: 2 weeks
* Update some definitions or make them match NetBSD's headers.pfg2012-11-282-6/+20
| | | | | | | | | | | | | | Bring several definitions required for newer ext4 features. Rename EXT2F_COMPAT_HTREE to EXT2F_COMPAT_DIRHASHINDEX since it is not being used yet and the new name is more compatible with NetBSD and Linux. This change is purely cosmetic and has no effect on the real code. Obtained from: NetBSD MFC after: 3 days
* Partially bring r242520 to ext2fs.pfg2012-11-281-0/+12
| | | | | | | | | | | | | | | | | | | | | When a file is first being written, the dynamic block reallocation (implemented by ext2_reallocblks) relocates the file's blocks so as to cluster them together into a contiguous set of blocks on the disk. When the cluster crosses the boundary into the first indirect block, the first indirect block is initially allocated in a position immediately following the last direct block. Block reallocation would usually destroy locality by moving the indirect block out of the way to keep the data blocks contiguous. The issue was diagnosed long ago by Bruce Evans on ffs and surfaced on ext2fs when block reallocaton was ported. This is only a partial solution based on the similarities with FFS. We still require more review of the allocation details that vary in ext2fs. Reported by: bde MFC after: 1 week
* - smbfs_rename() might return an error value without correctly upgradingdavide2012-11-262-2/+3
| | | | | | | | the vnode use count, and this might cause the kernel to panic if compiled with WITNESS enable. - Be sure to put the '\0' terminator to the rpath string. Sponsored by: iXsystems inc.
* - Remove reset of vpp pointer in some places as long as it's not reallydavide2012-11-223-5/+0
| | | | | | | | useful and has the side effect of obfuscating the code a bit. - Remove spurious references to simple_lock. Reported by: attilio [1] Sponsored by: iXsystems inc.
* Until now, smbfs_fullpath() computed the full path starting from thedavide2012-11-225-60/+63
| | | | | | | | | | | | | vnode and following back the chain of n_parent pointers up to the root, without acquiring the locks of the n_parent vnodes analyzed during the computation. This is immediately wrong because if the vnode lock is not held there's no guarantee on the validity of the vnode pointer or the data. In order to fix, store the whole path in the smbnode structure so that smbfs_fullpath() can use this information. Discussed with: kib Reported and tested by: pho Sponsored by: iXsystems inc.
* Remove the check and panic for an impossible condition. The NULLkib2012-11-201-2/+0
| | | | | | | lowervp vnode v_vnlock would cause panic due to NULL pointer dereference much earlier. MFC after: 1 week
* r16312 is not any longer real since many years (likely since when VFSattilio2012-11-196-36/+0
| | | | | | | | | | received granular locking) but the comment present in UFS has been copied all over other filesystems code incorrectly for several times. Removes comments that makes no sense now. Reviewed by: kib MFC after: 3 days
* In pget(9), if PGET_NOTWEXIT flag is not specified, also search thekib2012-11-161-25/+0
| | | | | | | | | | | | zombie list for the pid. This allows several kern.proc sysctls to report useful information for zombies. Hold the allproc_lock around all searches instead of relocking it. Remove private pfind_locked() from the new nfs client code. Requested and reviewed by: pjd Tested by: pho MFC after: 3 weeks
* Remove M_USE_RESERVE from the devfs cdp allocator, which is one of twokib2012-11-141-1/+1
| | | | | | | | uses of M_USE_RESERVE in the kernel. This allocation is not special. Reviewed by: alc Tested by: pho MFC after: 2 weeks
* Get rid of some old debug code. It provides checks similar to the onedavide2012-11-142-40/+0
| | | | | | offered by RedZone so there's no need to keep it. Sponsored by: iXsystems inc.
* Fix the lookup in the DOTDOT case in the same way as other filesystems do,davide2012-11-141-0/+21
| | | | | | i.e. inlining the vn_vget_ino() algorithm. Sponsored by: iXsystems inc.
* - Protect mnt_data and mnt_flags under the mount interlockattilio2012-11-101-7/+7
| | | | | | | | | | - Move mp->mnt_stat manipulation where all of them happens Reported by: davide Discussed with: kib Tested by: flo MFC after: 2 months X-MFC: 241519, 242536,242616, 242727
* Complete MPSAFE VFS interface and remove MNTK_MPSAFE flag.attilio2012-11-0914-27/+7
| | | | | Porters should refer to __FreeBSD_version 1000021 for this change as it may have happened at the same timeframe.
* - Current caching mode is completely broken because it simply reliesattilio2012-11-087-150/+16
| | | | | | | | | | | | | on timing of the operations and not real lookup, bringing too many false positives. Remove the whole mechanism. If it needs to be implemented, next time it should really be done in the proper way. - Fix VOP_GETATTR() in order to cope with userland bugs that would change the type of file and not panic. Instead it gets the entry as if it is not existing. Reported and tested by: flo MFC after: 2 months X-MFC: 241519, 242536,242616
* fuse_io* must be able to crunch also VDIR vnodes.attilio2012-11-051-2/+2
| | | | | | | | Update assert appropriately. Reported and Tested by: flo MFC after: 2 months X-MFC: 241519,242536
* Fix a bug where operations was carried on even if not implemented,attilio2012-11-031-6/+4
| | | | | | | | leading to handling of an invalid fdip object. Reported and tested by: flo MFC after: 2 months X-MFC: 241519
* The r241025 fixed the case when a binary, executed from nullfs mount,kib2012-11-022-2/+23
| | | | | | | | | | | | | | | | | | | | | | | was still possible to open for write from the lower filesystem. There is a symmetric situation where the binary could already has file descriptors opened for write, but it can be executed from the nullfs overlay. Handle the issue by passing one v_writecount reference to the lower vnode if nullfs vnode has non-zero v_writecount. Note that only one write reference can be donated, since nullfs only keeps one use reference on the lower vnode. Always use the lower vnode v_writecount for the checks. Introduce the VOP_GET_WRITECOUNT to read v_writecount, which is currently always bypassed to the lower vnode, and VOP_ADD_WRITECOUNT to manipulate the v_writecount value, which manages a single bypass reference to the lower vnode. Caling the VOPs instead of directly accessing v_writecount provide the fix described in the previous paragraph. Tested by: pho MFC after: 3 weeks
* - Do not put in the mntqueue half-constructed vnodes.davide2012-10-314-123/+69
| | | | | | | | | | - Change the code so that it relies on vfs_hash rather than on a home-made hashtable. - There's no need to inline fnv_32_buf(). Reviewed by: delphij Tested by: pho Sponsored by: iXsystems inc.
* Fix panic due to page faults while in kernel mode, under conditions ofdavide2012-10-317-169/+326
| | | | | | | | | VM pressure. The reason is that in some codepaths pointers to stack variables were passed from one thread to another. In collaboration with: pho Reported by: pho's stress2 suite Sponsored by: iXsystems inc.
* Change the code to use %jd as printf() placeholder for uio_offset anddavide2012-10-312-4/+7
| | | | | | | cast to intmax_t. Suggested by: pjd Sponsored by: iXsystems inc.
* Fix build in case we have SMBVDEBUG turned on.davide2012-10-252-4/+5
| | | | | | Reviewed by: gnn Approved by: gnn Sponsored by: iXsystems inc.
* - Remove the references to the deprecated zalloc kernel interfacedavide2012-10-252-36/+2
| | | | | | | | - Use M_ZERO flag in malloc() rather than bzero() - malloc() with M_NOWAIT can't return NULL so there's no need to check Reviewed by: alc Approved by: alc
* Remove the support for using non-mpsafe filesystem modules.kib2012-10-224-22/+7
| | | | | | | | | | | | In particular, do not lock Giant conditionally when calling into the filesystem module, remove the VFS_LOCK_GIANT() and related macros. Stop handling buffers belonging to non-mpsafe filesystems. The VFS_VERSION is bumped to indicate the interface change which does not result in the interface signatures changes. Conducted and reviewed by: attilio Tested by: pho
* remove duplicate semicolons where possible.eadler2012-10-221-1/+1
| | | | | Approved by: cperciva MFC after: 1 week
* Remove unneeded D_NEEDMINOR.ed2012-10-181-1/+0
| | | | This is only needed when using clonelists. This got remove in r238693.
* Add two new options to the nfssvc(2) syscall that allowrmacklem2012-10-142-1/+43
| | | | | | | | | | processes running as root to suspend/resume execution of the kernel nfsd threads. An earlier version of this patch was tested by Vincent Hoffman (vince at unsane.co.uk) and John Hickey (jh at deterlab.net). Reviewed by: kib MFC after: 2 weeks
* Grammar fixes.kib2012-10-141-3/+3
| | | | | Submitted by: bf MFC after: 1 week
* Replace the XXX comment with the proper description.kib2012-10-141-1/+3
| | | | MFC after: 1 week
* Rename s/DEBUG()/FS_DEBUG() and s/DEBUG2G()/FS_DEBUG2G() in order toattilio2012-10-148-84/+84
| | | | | | | avoid a name clash in sparc64. MFC after: 2 months X-MFC: r241519
* Import a FreeBSD port of the FUSE Linux module.attilio2012-10-1318-0/+8167
| | | | | | | | | | | | | | | | | | | | | | | | | This has been developed during 2 summer of code mandates and being revived by gnn recently. The functionality in this commit mirrors entirely content of fusefs-kmod port, which doesn't need to be installed anymore for -CURRENT setups. In order to get some sparse technical notes, please refer to: http://lists.freebsd.org/pipermail/freebsd-fs/2012-March/013876.html or to the project branch: svn://svn.freebsd.org/base/projects/fuse/ which also contains granular history of changes happened during port refinements. This commit does not came from the branch reintegration itself because it seems svn is not behaving properly for this functionaly at the moment. Partly Sponsored by: Google, Summer of Code program 2005, 2011 Originally submitted by: ilya, Csaba Henk <csaba-ml AT creo DOT hu > In collabouration with: pho Tested by: flo, gnn, Gustau Perez, Kevin Oberman <rkoberman AT gmail DOT com> MFC after: 2 months
* Fix the mis-handling of the VV_TEXT on the nullfs vnodes.kib2012-09-282-3/+3
| | | | | | | | | | | | | | | | If you have a binary on a filesystem which is also mounted over by nullfs, you could execute the binary from the lower filesystem, or from the nullfs mount. When executed from lower filesystem, the lower vnode gets VV_TEXT flag set, and the file cannot be modified while the binary is active. But, if executed as the nullfs alias, only the nullfs vnode gets VV_TEXT set, and you still can open the lower vnode for write. Add a set of VOPs for the VV_TEXT query, set and clear operations, which are correctly bypassed to lower vnode. Tested by: pho (previous version) MFC after: 2 weeks
* Fix up kernel sources to be ready for a 64-bit ino_t.mdf2012-09-277-67/+76
| | | | Original code by: Gleb Kurtsou
* Modify the NFSv4 client so that it can handle ownerrmacklem2012-09-206-25/+60
| | | | | | | | | | | | | | | and owner_group strings that consist entirely of digits, interpreting them as the uid/gid number. This change was needed since new (>= 3.3) Linux servers reply with these strings by default. This change is mandated by the rfc3530bis draft. Reported on freebsd-stable@ under the Subject heading "Problem with Linux >= 3.3 as NFSv4 server" by Norbert Aschendorff on Aug. 20, 2012. Tested by: norbert.aschendorff at yahoo.de Reviewed by: jhb MFC after: 2 weeks
* Prefer __containerof() above member2struct().ed2012-09-151-1/+1
| | | | | The first does proper checking of the argument types, while the latter does not.
* The deadfs VOPs for vop_ioctl and vop_bmap call itself recursively,kib2012-09-131-41/+2
| | | | | | | | | | | | | | | which is an elaborate way to cause kernel panic. Change the VOPs implementation to return EBADF for a reclaimed vnode. While the calls to vop_bmap should not reach deadfs, it is indeed possible for vop_ioctl, because the VOP locking protocol is to pass the vnode to VOP unlocked. The actual panic was observed when ioctl was called on procfs filedescriptor which pointed to an exited process. Reported by: zont Tested by: pho MFC after: 1 week
* Add VFCF_READONLY flag that indicates ntfs and xfs file systems arekevlo2012-09-121-1/+1
| | | | only supported as read-only.
* Prevent nump NULL pointer dereference in bmap_getlbns()kevlo2012-09-111-1/+2
|
* Fix style nitkevlo2012-09-111-2/+1
|
* Add a simple printf() based debug facility to the new nfs client.rmacklem2012-09-093-1/+11
| | | | | | | | | | Use it for a printf() that can be harmlessly generated for mmap()'d files. It will be used extensively for the NFSv4.1 client. Debugging printf()s are enabled by setting vfs.nfs.debuglevel to a non-zero value. The higher the value, the more debugging printf()s. Reviewed by: jhb MFC after: 2 weeks
* Allow shared lookups for nullfs mounts, if lower filesystem supportskib2012-09-094-46/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | it. There are two problems which shall be addressed for shared lookups use to have measurable effect on nullfs scalability: 1. When vfs_lookup() calls VOP_LOOKUP() for nullfs, which passes lookup operation to lower fs, resulting vnode is often only shared-locked. Then null_nodeget() cannot instantiate covering vnode for lower vnode, since insmntque1() and null_hashins() require exclusive lock on the lower. Change the assert that lower vnode is exclusively locked to only require any lock. If null hash failed to find pre-existing nullfs vnode for lower vnode and the vnode is shared-locked, the lower vnode lock is upgraded. 2. Nullfs reclaims its vnodes on deactivation. This is due to nullfs inability to detect reclamation of the lower vnode. Reclamation of a nullfs vnode at deactivation time prevents a reference to the lower vnode to become stale. Change nullfs VOP_INACTIVE to not reclaim the vnode, instead use the VFS_RECLAIM_LOWERVP to get notification and reclaim upper vnode together with the reclamation of the lower vnode. Note that nullfs reclamation procedure calls vput() on the lowervp vnode, temporary unlocking the vnode being reclaimed. This seems to be fine for MPSAFE filesystems, but not-MPSAFE code often put partially initialized vnode on some globally visible list, and later can decide that half-constructed vnode is not needed. If nullfs mount is created above such filesystem, then other threads might catch such not properly initialized vnode. Instead of trying to overcome this case, e.g. by recursing the lower vnode lock in null_reclaim_lowervp(), I decided to rely on nearby removal of the support for non-MPSAFE filesystems. In collaboration with: pho MFC after: 3 weeks
* Add some basic definitions for a future htree implementation.pfg2012-08-242-1/+4
| | | | MFC after: 3 days
* Fix typokevlo2012-08-181-1/+1
|
* Remove unused member of struct indir (in_exists) from UFS and EXT2 code.mjg2012-08-172-4/+0
| | | | | | Reviewed by: mckusick Approved by: trasz (mentor) MFC after: 1 week
* Streamline use of cdevpriv and correct some corner cases.hselasky2012-08-151-0/+3
| | | | | | | | | | | | | | | | | | | | 1) It is not useful to call "devfs_clear_cdevpriv()" from "d_close" callbacks, hence for example read, write, ioctl and so on might be sleeping at the time of "d_close" being called and then then freed private data can still be accessed. Examples: dtrace, linux_compat, ksyms (all fixed by this patch) 2) In sys/dev/drm* there are some cases in which memory will be freed twice, if open fails, first by code in the open routine, secondly by the cdevpriv destructor. Move registration of the cdevpriv to the end of the drm open routines. 3) devfs_clear_cdevpriv() is not called if the "d_open" callback registered cdevpriv data and the "d_open" callback function returned an error. Fix this. Discussed with: phk MFC after: 2 weeks
* Do not leave invalid pages in the object after the short read for akib2012-08-143-6/+10
| | | | | | | | | | | | | | network file systems (not only NFS proper). Short reads cause pages other then the requested one, which were not filled by read response, to stay invalid. Change the vm_page_readahead_finish() interface to not take the error code, but instead to make a decision to free or to (de)activate the page only by its validity. As result, not requested invalid pages are freed even if the read RPC indicated success. Noted and reviewed by: alc MFC after: 1 week
* After the PHYS_TO_VM_PAGE() function was de-inlined, the main reasonkib2012-08-055-0/+5
| | | | | | | | | | | | | to pull vm_param.h was removed. Other big dependency of vm_page.h on vm_param.h are PA_LOCK* definitions, which are only needed for in-kernel code, because modules use KBI-safe functions to lock the pages. Stop including vm_param.h into vm_page.h. Include vm_param.h explicitely for the kernel code which needs it. Suggested and reviewed by: alc MFC after: 2 weeks
* Reduce code duplication and exposure of direct access to structkib2012-08-043-90/+6
| | | | | | | | | vm_page oflags by providing helper function vm_page_readahead_finish(), which handles completed reads for pages with indexes other then the requested one, for VOP_GETPAGES(). Reviewed by: alc MFC after: 1 week
* The header uma_int.h is internal uma header, unused by this sourcekib2012-08-041-1/+0
| | | | | | | file. Do not include it needlessly. Reviewed by: alc MFC after: 1 week
OpenPOWER on IntegriCloud