summaryrefslogtreecommitdiffstats
path: root/sys/fs
Commit message (Collapse)AuthorAgeFilesLines
* Revert revision 224079 as Rick pointed out that I would be calling VOP_PATHCONFzack2011-07-172-13/+6
| | | | | | without the vnode lock held. Implicitly approved by: zml (mentor)
* The new NFSv4 client handled NFSERR_GRACE as a fatal errorrmacklem2011-07-161-1/+3
| | | | | | | | | | | | | | | for the remove and rename operations. Some NFSv4 servers will report NFSERR_GRACE for these operations. This patch changes the behaviour of the client so that it handles NFSERR_GRACE like NFSERR_DELAY for non-state related operations like remove and rename. It also exempts the delegreturn operation from handling within newnfs_request() for NFSERR_DELAY/NFSERR_GRACE so that it can handle NFSERR_GRACE in the same manner as before. This problem was resolved thanks to discussion with bfields at fieldses.org. The problem was identified at the recent NFSv4 ineroperability bakeathon. MFC after: 2 weeks
* Add DEXITCODE plumbing to NFS.zack2011-07-1612-546/+893
| | | | | | | | | | | | | | | | Isilon has the concept of an in-memory exit-code ring that saves the last exit code of a function and allows for stack tracing. This is very helpful when debugging tough issues. This patch is essentially a no-op for BSD at this point, until we upstream the dexitcode logic itself. The patch adds DEXITCODE calls to every NFS function that returns an errno error code. A number of code paths were also reorganized to have single exit paths, to reduce code duplication. Submitted by: David Kwan <dkwan@isilon.com> Reviewed by: rmacklem Approved by: zml (mentor) MFC after: 2 weeks
* Simple find/replace of VOP_ISLOCKED -> NFSVOPISLOCKED. This is done so that ↵zack2011-07-165-7/+7
| | | | | | | | NFSVOPISLOCKED can be modified later to add enhanced logging and assertions. Reviewed by: rmacklem Approved by: zml (mentor) MFC after: 2 weeks
* Simple find/replace of VOP_UNLOCK -> NFSVOPUNLOCK. This is done so that ↵zack2011-07-168-37/+37
| | | | | | | | NFSVOPUNLOCK can be modified later to add enhanced logging and assertions. Reviewed by: rmacklem Approved by: zml (mentor) MFC after: 2 weeks
* Simple find/replace of vn_lock -> NFSVOPLOCK. This is done so that ↵zack2011-07-168-26/+26
| | | | | | | | NFSVOPLOCK can be modified later to add enhanced logging and assertions. Reviewed by: rmacklem Approved by: zml (mentor) MFC after: 2 weeks
* Remove unnecessary thread pointer from VOPLOCK macros and current users.zack2011-07-164-14/+17
| | | | | | Reviewed by: rmacklem Approved by: zml (mentor) MFC after: 2 weeks
* Change loadattr and fillattr to ask the file system for the pathconf variable.zack2011-07-162-4/+12
| | | | | | | | Small modification where VOP_PATHCONF was being called directly. Reviewed by: rmacklem Approved by: zml (mentor) MFC after: 2 weeks
* Move nfsvno_pathconf to be accessible to sys/fs/nfs; no functionality change.zack2011-07-163-45/+45
| | | | | | Reviewed by: rmacklem Approved by: zml (mentor) MFC after: 2 weeks
* Small acl patch to return the aclerror that comes back from ↵zack2011-07-162-3/+3
| | | | | | | | nfsrv_dissectacl(). This fixes a problem where ATTRNOTSUPP was being returned instead of BADOWNER. Reviewed by: rmacklem Approved by: zml (mentor) MFC after: 2 weeks
* While fixing the looping of a thread while devfs vnode is reclaimed,kib2011-07-131-6/+12
| | | | | | | | | | | | | | | | | | | r179247 introduced a possibility of devfs_allocv() returning spurious ENOENT. If the vnode is selected by vnlru daemon for reclamation, then devfs_allocv() can get ENOENT from vget() due to devfs_close() dropping vnode lock around the call to cdevsw d_close method. Use LK_RETRY in the vget() call, and do some part of the devfs_reclaim() work in devfs_allocv(), clearing vp->v_data and de->de_vnode. Retry the allocation of the vnode, now with de->de_vnode == NULL. The check vp->v_data == NULL at the start of devfs_close() cannot be affected by the change, since vnode lock must be held while VI_DOOMED is set, and only dropped after the check. Reported and tested by: Kohji Okuno <okuno.kohji jp panasonic com> Reviewed by: attilio MFC after: 3 weeks
* r222389 introduced a case where the NFSv4 client couldrmacklem2011-07-131-1/+2
| | | | | | | | | | loop in nfscl_getcl() when a forced dismount is in progress, because nfsv4_lock() will return 0 without sleeping when MNTK_UNMOUNTF is set. This patch fixes it so it won't loop calling nfsv4_lock() for this case. MFC after: 2 weeks
* Make a comment more accurate.jonathan2011-07-071-1/+1
| | | | | | | | | This comment refers to CAP_NT_SMBS, which does not exist; it should refer to SMB_CAP_NT_SMBS. Fixing this comment makes it easier for people interested in Capsicum to grep around for capability rights, whose identifiers are of the form 'CAP_[A-Z_]'. Approved by: mentor (rwatson), re (Capsicum blanket) Sponsored by: Google Inc
* The algorithm used by nfscl_getopen() could have resulted inrmacklem2011-07-041-81/+94
| | | | | | | | | | | | | | | | multiple instances of the same lock_owner when a process both inherited an open file descriptor plus opened the same file itself. Since some NFSv4 servers cannot handle multiple instances of the same lock_owner string, this patch changes the algorithm used by nfscl_getopen() in the new NFSv4 client to keep that from happening. The new algorithm is simpler, since there is no longer any need to ascend the process's parentage tree because all NFSv4 Closes for a file are done at VOP_INACTIVE()/VOP_RECLAIM(), making the Opens indistinct w.r.t. use with Lock Ops. This problem was discovered at the recent NFSv4 interoperability Bakeathon. MFC after: 2 weeks
* Modify the new NFSv4 client so that it appends a file handlermacklem2011-07-033-21/+29
| | | | | | | | | | | | | to the lock_owner4 string that goes on the wire. Also, add code to do a ReleaseLockOwner Op on the lock_owner4 string before a Close. Apparently not all NFSv4 servers handle multiple instances of the same lock_owner4 string, at least not in a compatible way. This patch avoids having multiple instances, except for one unusual case, which will be fixed by a future commit. Found at the recent NFSv4 interoperability Bakeathon. Tested by: tdh at excfb.com MFC after: 2 weeks
* Add a new option, OBJPR_NOTMAPPED, to vm_object_page_remove(). Passing thisalc2011-06-291-1/+1
| | | | | | | | | | | | | | | | | | option to vm_object_page_remove() asserts that the specified range of pages is not mapped, or more precisely that none of these pages have any managed mappings. Thus, vm_object_page_remove() need not call pmap_remove_all() on the pages. This change not only saves time by eliminating pointless calls to pmap_remove_all(), but it also eliminates an inconsistency in the use of pmap_remove_all() versus related functions, like pmap_remove_write(). It eliminates harmless but pointless calls to pmap_remove_all() that were being performed on PG_UNMANAGED pages. Update all of the existing assertions on pmap_remove_all() to reflect this change. Reviewed by: kib
* Fix the new NFSv4 client so that it doesn't fill the cachedrmacklem2011-06-283-5/+15
| | | | | | | | | | | | mode attribute in as 0 when doing writes. The change adds the Mode attribute plus the others except Owner and Owner_group to the list requested by the NFSv4 Write Operation. This fixed a problem where an executable file built by "cc" would get mode 0111 instead of 0755 for some NFSv4 servers. Found at the recent NFSv4 interoperability Bakeathon. Tested by: tdh at excfb.com MFC after: 2 weeks
* Plug an mbuf leak in the new NFS client that occurred when armacklem2011-06-221-0/+2
| | | | | | | | server replied NFS3ERR_JUKEBOX/NFS4ERR_DELAY to an rpc. This affected both NFSv3 and NFSv4. Found during testing at the recent NFSv4 interoperability Bakeathon. MFC after: 2 weeks
* Fix the new NFSv4 client so that it uses the same uid asrmacklem2011-06-221-0/+14
| | | | | | | | | was used for doing a mount when performing system operations on AUTH_SYS mounts. This resolved an issue when mounting a Linux server. Found during testing at the recent NFSv4 interoperability Bakeathon. MFC after: 2 weeks
* Fix the new NFSv4 server so that it checks for VREAD_ACL whenrmacklem2011-06-211-6/+16
| | | | | | | a client does a Getattr for an ACL and not VREAD_ATTRIBUTES. This was found during the recent NFSv4 interoperability Bakeathon. MFC after: 2 weeks
* Fix the new NFSv4 server so that it only allows Lookup ofrmacklem2011-06-201-2/+10
| | | | | | | | directories and symbolic links when traversing non-exported file systems. Found during the recent NFSv4 interoperability Bakeathon. MFC after: 2 weeks
* Fix the new NFSv4 server so that it allows Access and Readlinkrmacklem2011-06-201-0/+2
| | | | | | | | operations while traversing non-exported file systems. This is required for some non-FreeBSD clients to do NFSv4 mounts. Found during the recent NFSv4 interoperability Bakeathon. MFC after: 2 weeks
* Fix a number of places where the new NFS server did notrmacklem2011-06-191-4/+15
| | | | | | | | | | | lock the mutex when manipulating rc_flag in the DRC cache. This is believed to fix a hung server that was reported to the freebsd-fs@ list on June 9 under the subject heading "New NFS server stress test hang", where all the threads were waiting for the RC_LOCKED flag to clear. Tested by: jwd at slowblink.com MFC after: 2 weeks
* Fix the kgssapi so that it can be loaded as a module. Currentlyrmacklem2011-06-193-45/+18
| | | | | | | | | | | | | the NFS subsystems use five of the rpcsec_gss/kgssapi entry points, but since it was not obvious which others might be useful, all nineteen were included. Basically the nineteen entry points are set in a structure called rpc_gss_entries and inline functions defined in sys/rpc/rpcsec_gss.h check for the entry points being non-NULL and then call them. A default value is returned otherwise. Requested by rwatson. Reviewed by: jhb MFC after: 2 weeks
* Add DTrace support to the new NFS client. This is essentiallyrmacklem2011-06-1810-5/+940
| | | | | | | cloned from the old NFS client, plus additions for NFSv4. A review of this code is in progress, however it was felt by the reviewer that it could go in now, before code slush. Any changes required by the review can be committed as bug fixes later.
* Add support for flock(2) locks to the new NFSv4 client. I think thisrmacklem2011-06-052-3/+9
| | | | | | | | | | should be ok, since the client now delays NFSv4 Close operations until VOP_INACTIVE()/VOP_RECLAIM(). As such, there should be no risk that the NFSv4 Open is closed while an associated byte range lock still exists. Tested by: avg MFC after: 2 weeks
* The new NFSv4 client was erroneously using "p" instead ofrmacklem2011-06-055-67/+66
| | | | | | | | | | "p_leader" for the "id" for POSIX byte range locking. I think this would only have affected processes created by rfork(2) with the RFTHREAD flag specified. This patch fixes that by passing the "id" down through the various functions from nfs_advlock(). MFC after: 2 weeks
* Fix the new NFSv4 client so that it doesn't crash whenrmacklem2011-06-051-0/+4
| | | | | | | | a mount is done for a VIMAGE kernel. Tested by: glz at hidden-powers dot com Reviewed by: bz MFC after: 2 weeks
* Modify the new NFS server so that the NFSv3 Pathconf RPCrmacklem2011-06-041-0/+30
| | | | | | | | | doesn't return an error when the underlying file system lacks support for any of the four _PC_xxx values used, by falling back to default values. Tested by: avg MFC after: 2 weeks
* In the VOP_PUTPAGES() implementations, change the default error fromkib2011-06-013-27/+10
| | | | | | | | | | | | | | | | VM_PAGER_AGAIN to VM_PAGER_ERROR for the uwritten pages. Return VM_PAGER_AGAIN for the partially written page. Always forward at least one page in the loop of vm_object_page_clean(). VM_PAGER_ERROR causes the page reactivation and does not clear the page dirty state, so the write is not lost. The change fixes an infinite loop in vm_object_page_clean() when the filesystem returns permanent errors for some page writes. Reported and tested by: gavin Reviewed by: alc, rmacklem MFC after: 1 week
* Fix the new NFS client so that it doesn't do an NFSv3rmacklem2011-05-311-2/+11
| | | | | | | | | | Pathconf RPC for cases where the reply doesn't include the answer. This fixes a problem reported by avg@ where the NFSv3 Pathconf RPC would fail when "ls -l" did an lpathconf(2) for _PC_ACL_NFS4. Tested by: avg MFC after: 2 weeks
* Fix the new NFS client so that it handles NFSv4 statermacklem2011-05-276-34/+109
| | | | | | | | | | | | | | | | | correctly during a forced dismount. This required that the exclusive and shared (refcnt) sleep lock functions check for MNTK_UMOUNTF before sleeping, so that they won't block while nfscl_umount() is getting rid of the state. As such, a "struct mount *" argument was added to the locking functions. I believe the only remaining case where a forced dismount can get hung in the kernel is when a thread is already attempting to do a TCP connect to a dead server when the krpc client structure called nr_client is NULL. This will only happen just after a "mount -u" with options that force a new TCP connection is done, so it shouldn't be a problem in practice. MFC after: 2 weeks
* Add a check for MNTK_UNMOUNTF at the beginning of nfs_sync()rmacklem2011-05-261-1/+11
| | | | | | | | | in the new NFS client so that a forced dismount doesn't get stuck in the VFS_SYNC() call that happens before VFS_UNMOUNT() in dounmount(). Additional changes are needed before forced dismounts will work. MFC after: 2 weeks
* Add some missing mutex locking to the new NFS client.rmacklem2011-05-251-0/+2
| | | | MFC after: 2 weeks
* Fix the new NFS client so that it correctly sets the "must_commit"rmacklem2011-05-253-18/+11
| | | | | | | | argument for a write RPC when it succeeds for the first one and fails for a subsequent RPC within the same call to the function. This makes it compatible with the old NFS client for this case. MFC after: 2 weeks
* Set the MNT_NFS4ACLS flag for an NFSv4 client mountrmacklem2011-05-231-0/+10
| | | | | | if the NFSv4 server supports it. Requested by trasz. MFC after: 2 weeks
* Eliminate duplicate #include's.alc2011-05-221-1/+0
|
* Add a lock flags argument to the VFS_FHTOVP() file systemrmacklem2011-05-2210-11/+19
| | | | | | | | | | | method, so that callers can indicate the minimum vnode locking requirement. This will allow some file systems to choose to return a LK_SHARED locked vnode when LK_SHARED is specified for the flags argument. This patch only adds the flag. It does not change any file system to use it and all callers specify LK_EXCLUSIVE, so file system semantics are not changed. Reviewed by: kib
* Add a sanity check for the existence of an "addr" optionrmacklem2011-05-181-7/+13
| | | | | | | | | | to both NFS clients. This avoids the crash reported by Sergey Kandaurov (pluknet@gmail.com) to the freebsd-fs@ list with subject "[old nfsclient] different nmount() args passed from mount vs mount_nfs" dated May 17, 2011. Tested by: pluknet at gmail.com (old nfs client) MFC after: 2 weeks
* Change the sysctl naming for the old and new NFS clientsrmacklem2011-05-157-40/+34
| | | | | to vfs.oldnfs.xxx and vfs.nfs.xxx respectively. This makes the default nfs client use vfs.nfs.xxx after r221124.
* Merge comments about converting directory entries to be more direct andjhb2011-05-141-11/+5
| | | | | | concise. Inspired by: Gleb Kurtsou
* Change the new NFS server so that it uses vfs.nfsd namingrmacklem2011-05-082-11/+11
| | | | | for its sysctls instead of vfs.newnfs. This separates the names from the ones used by the client.
* Set the initial value of maxfilesize to OFF_MAX in thermacklem2011-05-061-1/+1
| | | | | | | | | | | new NFS client. It will then be reduced to whatever the server says it can support. There might be an argument that this could be one block larger, but since NFS is a byte granular system, I chose not to do that. Suggested by: Matt Dillon Tested by: Daniel Braniss (earlier version) MFC after: 2 weeks
* Increase NFS_TICKINTVL value from 10 to 500. Now that callout does usefulmav2011-05-061-1/+1
| | | | | | | things only once per second, so other 99 calls per second were useless and just don't allow idle system to sleep properly. Reviewed by: rmacklem
* Change the new NFS server so that it returns 0 when the f_bavailrmacklem2011-05-061-1/+16
| | | | | | | | | or f_ffree fields of "struct statfs" are negative, since the values that go on the wire are unsigned and will appear to be very large positive values otherwise. This makes the handling of a negative f_bavail compatible with the old/regular NFS server. MFC after: 2 weeks
* Fix the new NFS client so that it handles the 64bit fieldsrmacklem2011-05-051-11/+23
| | | | | | | | | that are now in "struct statfs" for NFSv3 and NFSv4. Since the ffiles value is uint64_t on the wire, I clip the value to INT64_MAX to avoid setting f_ffree negative. Tested by: kib MFC after: 2 weeks
* Add a comment noting that the NFS code assumes that thermacklem2011-05-041-0/+8
| | | | | | | | | values of error numbers in sys/errno.h will be the same as the ones specified by the NFS RFCs and that the code needs to be fixed if error numbers are changed in sys/errno.h. Suggested by: Peter Jeremy MFC after: 2 weeks
* Add kernel support for NFSSVC_ZEROCLTSTATS and NFSSVC_ZEROSRVSTATSrmacklem2011-05-041-0/+58
| | | | | | | so that they can be used by nfsstat(1) to implement the "-z" option for the new NFS subsystem. MFC after: 2 weeks
* Revert r221306, since NFSSVC_ZEROSTATS zero'd both client andrmacklem2011-05-041-2/+0
| | | | | server stats, when separate modifiers for NFSSVC_GETSTATS for each of client and server stats is what it required by nfsstat(1).
* Implemented a mount option "nocto" that disables cache coherencyru2011-05-042-2/+5
| | | | | | | | checking at open time. It may improve performance for read-only NFS mounts. Use deliberately. MFC after: 1 week Reviewed by: rmacklem, jhb (earlier version)
OpenPOWER on IntegriCloud