summaryrefslogtreecommitdiffstats
path: root/sys/fs
Commit message (Collapse)AuthorAgeFilesLines
* Delete the NFS_STARTWRITE() and NFS_ENDWRITE() macros thatrmacklem2011-01-062-9/+2
| | | | | | | | obscured vn_start_write() and vn_finished_write() for the old OpenBSD port, since most uses have been replaced by the correct calls. MFC after: 12 days
* Since the VFS_LOCK_GIANT() code in the experimental NFSrmacklem2011-01-065-171/+54
| | | | | | | | | server is broken and the major file systems are now all mpsafe, modify the server so that it will only export mpsafe file systems. This was discussed on freebsd-fs@ and removes a fair bit of crufty code. MFC after: 12 days
* Modify the experimental NFS server so that it callsrmacklem2011-01-051-7/+8
| | | | | | | | | | | vn_start_write() with a non-NULL vp. That way it will find the correct mount point mp and use that mp for the subsequent vn_finished_write() call. Also, it should fail without crashing if the mount point is being forced dismounted because vn_start_write() will set the mp NULL via VOP_GETWRITEMOUNT(). Reviewed by: kib MFC after: 12 days
* Fix the experimental NFS server to use vfs_busyfs() insteadrmacklem2011-01-051-6/+5
| | | | | | | | | of vfs_getvfs() so that the mount point is busied for the VFS_FHTOVP() call. This is analagous to r185432 for the regular NFS server. Reviewed by: kib MFC after: 12 days
* Fix the nlm so that it no longer depends on the regularrmacklem2011-01-033-2/+11
| | | | | | | | nfs client and, as such, can be loaded for the experimental nfs client without the regular client. Reviewed by: jhb MFC after: 2 weeks
* Fix the experimental NFS server so that it doesn't leakrmacklem2011-01-031-2/+1
| | | | | | | a reference count on the directory when creating device special files. MFC after: 2 weeks
* Modify the experimental NFSv4 server so that the lookuprmacklem2011-01-032-13/+13
| | | | | | | | | ops return a locked vnode. This ensures that the associated mount point will always be valid for the code that follows the operation. Also add a couple of additional checks for non-error to the other functions that create file objects. MFC after: 2 weeks
* Delete some cruft from the experimental NFS server that wasrmacklem2011-01-023-42/+9
| | | | | | only used by the OpenBSD port for its pseudo-fs. MFC after: 2 weeks
* Add checks for VI_DOOMED and vn_lock() failures to thermacklem2011-01-024-51/+99
| | | | | | | | | | experimental NFS server, to handle the case where an exported file system is forced dismounted while an RPC is in progress. Further commits will fix the cases where a mount point is used when the associated vnode isn't locked. Reviewed by: kib MFC after: 2 weeks
* Add support for shared vnode locks for the Read operationrmacklem2011-01-012-7/+9
| | | | | | | in the experimental NFSv4 server. Reviewed by: kib MFC after: 2 weeks
* Delete the nfsvno_localconflict() function in the experimentalrmacklem2010-12-282-62/+0
| | | | | | NFS server since it is no longer used and is broken. MFC after: 2 weeks
* Modify the experimental NFS server so that it uses LK_SHAREDrmacklem2010-12-256-78/+102
| | | | | | | | | | | | for RPC operations when it can. Since VFS_FHTOVP() currently always gets an exclusively locked vnode and is usually called at the beginning of each RPC, the RPCs for a given vnode will still be serialized. As such, passing a lock type argument to VFS_FHTOVP() would be preferable to doing the vn_lock() with LK_DOWNGRADE after the VFS_FHTOVP() call. Reviewed by: kib MFC after: 2 weeks
* Add an argument to nfsvno_getattr() in the experimentalrmacklem2010-12-243-62/+71
| | | | | | | | | | | | | NFS server, so that it can avoid calling VOP_ISLOCKED() when the vnode is known to be locked. This will allow LK_SHARED to be used for these cases, which happen to be all the cases that can use LK_SHARED. This does not fix any bug, but it reduces the number of calls to VOP_ISLOCKED() and prepares the code so that it can be switched to using LK_SHARED in a future patch. Reviewed by: kib MFC after: 2 weeks
* Simplify vnode locking in the expeimental NFS server'srmacklem2010-12-241-16/+11
| | | | | | | | | readdir functions. In particular, get rid of two bogus VOP_ISLOCKED() calls. Removing the VOP_ISLOCKED() calls is the only actual bug fixed by this patch. Reviewed by: kib MFC after: 2 weeks
* Since VOP_READDIR() for ZFS does not return monotonicallyrmacklem2010-12-241-2/+10
| | | | | | | | | | | | | | | | increasing directory offset cookies, disable the UFS related loop that skips over directory entries at the beginning of the block for the experimental NFS server. This loop is required for UFS since it always returns directory entries starting at the beginning of the block that the requested directory offset is in. In discussion with pjd@ and mckusick@ it seems that this behaviour of UFS should maybe change, with this fix being an interim patch until then. This patch only fixes the experimental server, since pjd@ is working on a patch for the regular server. Discussed with: pjd, mckusick MFC after: 5 days
* Fix two vnode locking problems in nfsd_recalldelegation() in thermacklem2010-12-171-4/+8
| | | | | | | | | | experimental NFSv4 server. The first was a bogus use of VOP_ISLOCKED() in a KASSERT() and the second was the need to lock the vnode for the nfsrv_checkremove() call. Also, delete a "__unused" that was bogus, since the argument is used. Reviewed by: zack.kirsch at isilon.com MFC after: 2 weeks
* Don't allow user created symbolic links to cover another entries markedjh2010-12-151-0/+5
| | | | | | | with DE_USER. If a devfs rule hid such entry, it was possible to create infinite number of symbolic links with the same name. Reviewed by: kib
* - Assert that dm_lock is exclusively held in devfs_rules_apply() andjh2010-12-153-0/+5
| | | | | | | | in devfs_vmkdir() while adding the entry to de_list of the parent. - Apply devfs rules to newly created directories and symbolic links. PR: kern/125034 Submitted by: Mateusz Guzik (original version)
* Handle the special ruleset 0 in devfs_ruleset_use(). An attempt set thejh2010-12-121-0/+5
| | | | | | | | current ruleset to 0 with command "devfs ruleset 0" triggered a KASSERT in devfs_ruleset_create(). PR: kern/125030 Submitted by: Mateusz Guzik
* Disable attempts to establish a callback connection from thermacklem2010-12-091-5/+13
| | | | | | | | | | | | | | | | | | experimental NFSv4 server to a NFSv4 client when delegations are not being issued, even if the client advertises a callback path. This avoids a problem where a Linux client advertises a callback path that doesn't work, due to a firewall, and then times out an Open attempt before the FreeBSD server gives up its callback connection attempt. (Suggested by drb at karlov.mff.cuni.cz to fix the Linux client problem that he reported on the fs-stable mailing list.) The server should probably have a 1sec timeout on callback connection attempts when there are no delegations issued to the client, but that patch will require changes to the krpc and this serves as a work around until then. Tested by: drb at karlov.mff.cuni.cz MFC after: 5 days
* Replace pointer to "struct uidinfo" with pointer to "struct ucred"trasz2010-12-021-3/+3
| | | | | | | | | in "struct vm_object". This is required to make it possible to account for per-jail swap usage. Reviewed by: kib@ Tested by: pho@ Sponsored by: FreeBSD Foundation
* For non-stopped threads, td_frame pointer is undefined. As akib2010-12-022-0/+8
| | | | | | | | | | | | | | consequence, fill_regs() and fill_fpregs() access random data, usually on the thread kernel stack. Most often the td_frame points to the previous frame saved by last kernel entry sequence, but this is not guaranteed. For /proc/<pid>/{regs,fpregs} read access, require the thread to be in stopped state. Otherwise, return EBUSY as is done for write case. Reported and tested by: pho Approved by: des (procfs maintainer) MFC after: 1 week
* Remove prtactive variable and related printf()s in the vop_inactivekib2010-11-197-37/+3
| | | | | | | | and vop_reclaim() methods. They seems to be unused, and the reported situation is normal for the forced unmount. MFC after: 1 week X-MFC-note: keep prtactive symbol in vfs_subr.c
* Remove unused includes of <sys/mutex.h> and <machine/mutex.h>.jhb2010-11-091-2/+0
|
* Modify nfs_open() in the experimental NFS client to be compatiblermacklem2010-10-291-46/+40
| | | | | | with the regular NFS client. Also, fix a couple of mutex lock issues. MFC after: 1 week
* Add a call for nfsrpc_close() to ncl_reclaim() in the experimentalrmacklem2010-10-291-0/+9
| | | | | | | | NFSv4 client, since the call in ncl_inactive() might be missed because VOP_INACTIVE() is not guaranteed to be called before VOP_RECLAIM(). MFC after: 1 week
* Add a flag to the experimental NFSv4 client to indicate whenrmacklem2010-10-262-22/+24
| | | | | | | | | | | | | delegations are being returned for reasons other than a Recall. Also, re-organize nfscl_recalldeleg() slightly, so that it leaves clearing NMODIFIED to the ncl_flush() call and invalidates the attribute cache after flushing. It is hoped that these changes might fix the problem others have seen when using the NFSv4 client with delegations enabled, since I can't reliably reproduce the problem. These changes only affect the client when doing NFSv4 mounts with delegations enabled. MFC after: 10 days
* Modify the experimental NFSv4 server's file handle hash functionrmacklem2010-10-232-7/+5
| | | | | | | | | | | to use the generic hash32_buf() function. Although adding the bytes seemed sufficient for UFS and ZFS, since most of the bytes are the same for file handles on the same volume, this might not be sufficient for other file systems. Use of a generic function also seems preferable to one specific to NFSv4. Suggested by: gleb.kurtsou at gmail.com MFC after: 10 days
* Modify the file handle hash function in the experimental NFSrmacklem2010-10-223-1/+17
| | | | | | | | server so that it will work better for non-UFS file systems. The new function simply sums the bytes of the fh_fid field of fhandle_t. MFC after: 10 days
* Modify the experimental NFS server in a manner analagous tormacklem2010-10-211-1/+9
| | | | | | | | r214049 for the regular NFS server, so that it will not do a VOP_LOOKUP() of ".." when at the root of a file system when performing a ReaddirPlus RPC. MFC after: 10 days
* Fix the type of the 3rd argument for nm_getinfo so that it worksrmacklem2010-10-191-3/+3
| | | | | | | for architectures like sparc64. Suggested by: kib MFC after: 2 weeks
* Modify the NFS clients and the NLM so that the NLM can be usedrmacklem2010-10-194-16/+58
| | | | | | | | | | | | | by both clients. Since the NLM uses various fields of the nfsmount structure, those fields were extracted and put in a separate nfs_mountcommon structure stored in sys/nfs/nfs_mountcommon.h. This structure also has a function pointer for a function that extracts the required information from the mount point and nfs vnode for that particular client, for information stored differently by the clients. Reviewed by: jhb MFC after: 2 weeks
* Fix a possible race where the directory dirent is moved to the locationkevlo2010-10-181-3/+8
| | | | | | | | | that was used by ".." entry. This change seems fixed panic during attempt to access msdosfs data over nfs. Reviewed by: kib MFC after: 1 week
* Ignore the return value of DE_INTERNALIZE().rpaulo2010-10-131-1/+1
|
* tmpfs + sendfile: do not produce partially valid pages for vnode's tailavg2010-10-121-3/+6
| | | | | | See r213730 for details of analogous change in ZFS. MFC after: 3 days
* Format prototypes to follow style(9) more closely.jh2010-10-122-22/+25
| | | | Discussed with: kib, phk
* Try and make the nfsrv_localunlock() function in the experimentalrmacklem2010-10-111-8/+36
| | | | | | | | | | NFSv4 server more readable. Mostly changes to comments, but a case of >= is changed to >, since == can never happen. Also, I've added a couple of KASSERT()s and a slight optimization, since once the "else if" case happens, subsequent locks in the list can't have any effect. None of these changes fixes any known bug. MFC after: 2 weeks
* The r184588 changed the layout of struct export_args, causing an ABIkib2010-10-108-10/+18
| | | | | | | | | | breakage for old mount(2) syscall, since most struct <filesystem>_args embed export_args. The mount(2) is supposed to provide ABI compatibility for pre-nmount mount(8) binaries, so restore ABI to pre-r184588. Requested and reviewed by: bde MFC after: 2 weeks
* Add a comment describing the reason for calling cache_purge(fvp).kib2010-10-081-0/+7
| | | | | Requested by: danfe MFC after: 6 days
* The msdosfs lookup is case insensitive. Several aliases may be inserted forkib2010-10-071-0/+1
| | | | | | | | | | | a single directory entry. As a consequnce, name cache purge done by lookup for fvp when DELETE op for namei is specified, might be not enough to expunge all namecache entries that were installed for this direntry. Explicitely call cache_purge(fvp) when msdosfs_rename() succeeded. PR: kern/93634 MFC after: 1 week
* M_USE_RESERVE has been deprecated for a decade. Eliminate any uses thatalc2010-10-022-4/+2
| | | | have no run-time effect.
* Add a new function devfs_dev_exists() to be able to find out if ajh2010-09-272-0/+22
| | | | | | | | | specific devfs path already exists. The function will be used from kern_conf.c to detect duplicate device registrations. Callers must hold the devmtx mutex. Reviewed by: kib
* Add reference counting for devfs paths containing user created symbolicjh2010-09-275-2/+199
| | | | | | | | | | | | | | | | links. The reference counting is needed to be able to determine if a specific devfs path exists. For true device file paths we can traverse the cdevp_list but a separate directory list is needed for user created symbolic links. Add a new directory entry flag DE_USER to mark entries which should unreference their parent directory on deletion. A new function to traverse cdevp_list and the directory list will be introduced in a separate commit. Idea from: kib Reviewed by: kib
* Modify devfs_fqpn() for future use in devfs path reference countingjh2010-09-212-14/+23
| | | | | | | | | | | | | code: - Accept devfs_mount and devfs_dirent as the arguments instead of a vnode. This generalizes the function so that it can be used from contexts where vnode references are not available. - Accept NULL cnp argument. No '/' will be appended, if a NULL cnp is provided. - Make the function global and add its prototype to devfs.h. Reviewed by: kib
* Fix nfsrv_freeallnfslocks() in the experimental NFSv4 server so thatrmacklem2010-09-191-4/+7
| | | | | | | | | | | | it frees local locks correctly upon close. In order for nfsrv_localunlock() to work correctly, the lock can no longer be in the lockowner's stateid list. As such, nfsrv_freenfslock() has to be called before nfsrv_localunlock(), to get rid of the lock structure on the lockowner's stateid list. This only affected operation when local locks (vfs.newnfs.enable_locallocks=1) are enabled, which is not the default at this time. MFC after: 1 week
* Fix the experimental NFSv4 server so that it performs local VOP_ADVLOCK()rmacklem2010-09-191-3/+7
| | | | | | | | unlock operations correctly. It was passing in F_SETLK instead of F_UNLCK as the operation for the unlock case. This only affected operation when local locking (vfs.newnfs.enable_locallocks=1) was enabled. MFC after: 1 week
* - For consistency, remove "." and ".." entries from de_dlist beforejh2010-09-181-0/+4
| | | | | | | | | calling devfs_delete() (and thus possibly dropping dm_lock) in devfs_rmdir_empty(). - Assert that we don't return doomed entries from devfs_find(). [1] Suggested by: kib [1] Reviewed by: kib
* Remove empty devfs directories automatically.jh2010-09-153-17/+106
| | | | | | | | | | | | | | | | | | | | devfs_delete() now recursively removes empty parent directories unless the DEVFS_DEL_NORECURSE flag is specified. devfs_delete() can't be called anymore with a parent directory vnode lock held because the possible parent directory deletion needs to lock the vnode. Thus we unlock the parent directory vnode in devfs_remove() before calling devfs_delete(). Call devfs_populate_vp() from devfs_symlink() and devfs_vptocnp() as now directories can get removed. Add a check for DE_DOOMED flag to devfs_populate_vp() because devfs_delete() drops dm_lock before the VI_DOOMED vnode flag gets set. This ensures that devfs_populate_vp() returns an error for directories which are in progress of deletion. Reviewed by: kib Discussed on: freebsd-current (mostly silence)
* tmpfs, zfs + sendfile: mark page bits as valid after populating it with dataavg2010-09-151-0/+2
| | | | | | | | | | | | Otherwise, adding insult to injury, in addition to double-caching of data we would always copy the data into a vnode's vm object page from backend. This is specific to sendfile case only (VOP_READ with UIO_NOCOPY). PR: kern/141305 Reported by: Wiktor Niesiobedzki <bsd@vink.pl> Reviewed by: alc Tested by: tools/regression/sockets/sendfile MFC after: 2 weeks
* This patch applies one of the two fixes suggested byrmacklem2010-09-101-1/+6
| | | | | | | | | | | | zack.kirsch at isilon.com for a race between nfsrv_freeopen() and nfsrv_getlockfile() in the experimental NFS server that he found during testing. Although nfsrv_freeopen() holds a sleep lock on the lock file structure when called with cansleep != 0, nfsrv_getlockfile() could still search the list, once it acquired the NFSLOCKSTATE() mutex. I believe that acquiring the mutex in nfsrv_freeopen() fixes the race. MFC after: 2 weeks
OpenPOWER on IntegriCloud