summaryrefslogtreecommitdiffstats
path: root/sys/fs/nfs
Commit message (Collapse)AuthorAgeFilesLines
* Modify the NFSv4 client so that it can handle ownerrmacklem2012-09-204-20/+53
| | | | | | | | | | | | | | | 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
* Add a simple printf() based debug facility to the new nfs client.rmacklem2012-09-092-0/+9
| | | | | | | | | | 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
* 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
* A problem with the NFSv4 server was reported by Andrew Leonardrmacklem2012-05-171-3/+1
| | | | | | | | | | | | to freebsd-fs@, where the setfacl of an NFSv4 acl would fail. This was caused by the VOP_ACLCHECK() call for ZFS replying EOPNOTSUPP. After discussion with rwatson@, it was determined that a call to VOP_ACLCHECK() before doing VOP_SETACL() is not required. This patch fixes the problem by deleting the VOP_ACLCHECK() call. Tested by: Andrew Leonard (previous version) MFC after: 1 week
* Remove fifo.h. The only used function declaration from the header iskib2012-03-111-1/+0
| | | | | | migrated to sys/vnode.h. Submitted by: gianni
* Delete a couple of out of date comments that are no longer true inrmacklem2012-02-161-3/+0
| | | | | | | the new NFS client. Requested by: bde MFC after: 1 week
* Martin Cracauer reported a problem to freebsd-current@ under thermacklem2012-01-201-18/+31
| | | | | | | | | | | | | | | | | | | | subject "Data corruption over NFS in -current". During investigation of this, I came across an ugly bogusity in the new NFS client where it replaced the cr_uid with the one used for the mount. This was done so that "system operations" like the NFSv4 Renew would be performed as the user that did the mount. However, if any other thread shares the credential with the one doing this operation, it could do an RPC (or just about anything else) as the wrong cr_uid. This patch fixes the above, by using the mount credentials instead of the one provided as an argument for this case. It appears to have fixed Martin's problem. This patch is needed for NFSv4 mounts and NFSv3 mounts against some non-FreeBSD servers that do not put post operation attributes in the NFSv3 Statfs RPC reply. Tested by: Martin Cracauer (cracauer at cons.org) Reviewed by: jhb MFC after: 2 weeks
* jwd@ reported via email that the "CacheSize" field reported by "nfsstat -e -s"rmacklem2012-01-111-1/+0
| | | | | | | | would go negative after using the "-z" option to zero out the stats. This patch fixes that by not zeroing out the srvcache_size field for "-z", since it is the size of the cache and not a counter. MFC after: 2 weeks
* opt_inet6.h was missing from some files in the new NFS subsystem.rmacklem2012-01-082-1/+2
| | | | | | | | | | The effect of this was, for clients mounted via inet6 addresses, that the DRC cache would never have a hit in the server. It also broke NFSv4 callbacks when an inet6 address was the only one available in the client. This patch fixes the above, plus deletes opt_inet6.h from a couple of files it is not needed for. MFC after: 2 weeks
* Use strchr() and strrchr().ed2012-01-021-1/+1
| | | | | | | | It seems strchr() and strrchr() are used more often than index() and rindex(). Therefore, simply migrate all kernel code to use it. For the XFS code, remove an empty line to make the code identical to the code in the Linux kernel.
* jwd@ reported a problem via email where the old NFS client wouldrmacklem2011-12-211-6/+57
| | | | | | | | | | | | | | | | | | | | | | | get a reply of EEXIST from an NFS server when a Mkdir RPC was retried, for an NFS over UDP mount. Upon investigation, it was found that the client was retransmitting the Mkdir RPC request over UDP, but with a different xid. As such, the retransmitted message would miss the Duplicate Request Cache in the server, causing it to reply EEXIST. The kernel client side UDP rpc code has two timers. The first one causes a retransmit using the same xid and socket and was set to a fixed value of 3seconds. (The default can be overridden via CLSET_RETRY_TIMEOUT.) The second one creates a new socket and xid and should be larger than the first. However, both NFS clients were setting the second timer to nm_timeo ("timeout=<value>" mount argument), which defaulted to 1second, so the first timer would never time out. This patch fixes both NFS clients so that they set the first timer using nm_timeo and makes the second timer larger than the first one. Reported by: jwd Tested by: jwd Reviewed by: jhb MFC after: 2 weeks
* Post r223774, the NFSv4 client no longer has multiple instancesrmacklem2011-12-031-1/+10
| | | | | | | | | | | | | | | | | of the same lock_owner4 string. As such, the handling of cleanup of lock_owners could be simplified. This simplification permitted the client to do a ReleaseLockOwner operation when the process that the lock_owner4 string represents, has exited. This permits the server to release any storage related to the lock_owner4 string before the associated open is closed. Without this change, it is possible to exhaust a server's storage when a long running process opens a file and then many child processes do locking on the file, because the open doesn't get closed. A similar patch was applied to the Linux NFSv4 client recently so that it wouldn't exhaust a server's storage. Reviewed by: zack MFC after: 2 weeks
* Add two arguments to the nfsrpc_rellockown() function in the NFSv4rmacklem2011-11-201-2/+2
| | | | | | | | client. This does not change the client's behaviour, but prepares the code so that nfsrpc_rellockown() can be called elsewhere in a future commit. MFC after: 2 weeks
* Post r223774 the NFSv4 client never uses the linked list with thermacklem2011-11-201-1/+0
| | | | | | | | | head nfsc_defunctlockowner. This patch simply removes the code that loops through this always empty list, since the code no longer does anything useful. It should not have any effect on the client's behaviour. MFC after: 2 weeks
* 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-165-107/+209
| | | | | | | | | | | | | | | | 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_UNLOCK -> NFSVOPUNLOCK. This is done so that ↵zack2011-07-161-1/+1
| | | | | | | | 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-161-1/+1
| | | | | | | | 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-161-3/+6
| | | | | | 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-162-2/+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-161-2/+2
| | | | | | | | 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
* Modify the new NFSv4 client so that it appends a file handlermacklem2011-07-031-0/+1
| | | | | | | | | | | | | 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
* Fix the new NFSv4 client so that it doesn't fill the cachedrmacklem2011-06-281-3/+12
| | | | | | | | | | | | 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 kgssapi so that it can be loaded as a module. Currentlyrmacklem2011-06-191-10/+4
| | | | | | | | | | | | | 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-183-0/+113
| | | | | | | 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.
* The new NFSv4 client was erroneously using "p" instead ofrmacklem2011-06-051-9/+10
| | | | | | | | | | "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 NFS client so that it handles NFSv4 statermacklem2011-05-272-5/+18
| | | | | | | | | | | | | | | | | 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
* Fix the new NFS client so that it correctly sets the "must_commit"rmacklem2011-05-251-1/+1
| | | | | | | | 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
* Change the sysctl naming for the old and new NFS clientsrmacklem2011-05-152-12/+10
| | | | | to vfs.oldnfs.xxx and vfs.nfs.xxx respectively. This makes the default nfs client use vfs.nfs.xxx after r221124.
* 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
* 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).
* Add the kernel support needed to zero out the nfsstatsrmacklem2011-05-011-0/+2
| | | | | | | structure for the new NFS subsystem. This will be used by nfsstats.c to implement the "-z" option. MFC after: 2 weeks
* Modify the experimental (newnfs) NFS client so that it uses thermacklem2011-04-251-1/+0
| | | | | | | | same diskless NFS root code as the regular client, which was moved to sys/nfs by r221032. This fixes the newnfs client so that it can do an NFSv3 diskless root file system. MFC after: 2 weeks
* Modify the experimental NFS client so that it uses the samermacklem2011-04-251-1/+1
| | | | | | | | | | | | | | "struct nfs_args" as the regular NFS client. This is needed so that the old mount(2) syscall will work and it makes sharing of the diskless NFS root code easier. Eary in the porting exercise I introduced a new revision of nfs_args, but didn't actually need it, thanks to nmount(2). I re-introduced the NFSMNT_KERB flag, since it does essentially the same thing and the old one would not have been used because it never worked. I also added a few new NFSMNT_xxx flags to sys/nfsclient/nfs_args.h that are used by the experimental NFS client. MFC after: 2 weeks
* Get rid of the "nfscl: consider increasing kern.ipc.maxsockbuf"rmacklem2011-04-171-7/+2
| | | | | | | | | | message that was generated when doing experimental NFS client mounts. I put that message in because the krpc would hang with the default size for mounts that used large rsize/wsize values. Since the bug that caused these hangs was fixed by r213756, I think the message is no longer needed. MFC after: 2 weeks
* Fix up some of the sysctls for the experimental NFS client sormacklem2011-04-171-4/+8
| | | | | | | that they use the same names as the regular client. Also add string descriptions for them. MFC after: 2 weeks
* Change some defaults in the experimental NFS client to be thermacklem2011-04-171-0/+1
| | | | | | | | | same as the regular NFS client for NFSv3. The main one is making use of a reserved port# the default. Also, set the retry limit for TCP the same and fix the code so that it doesn't disable readdirplus for NFSv4. MFC after: 2 weeks
* Add a lktype flags argument to nfscl_nget() and ncl_nget() in thermacklem2011-04-161-1/+1
| | | | | | | experimental NFS client so that its nfs_lookup() function can use cn_lkflags in a manner analagous to the regular NFS client. MFC after: 2 weeks
* Change the experimental NFS client so that it creates nfsiodrmacklem2011-04-151-2/+3
| | | | | | | | | threads in the same manner as the regular NFS client after r214026 was committed. This resolves the lors fixed by r214026 and its predecessors for the regular client. Reviewed by: jhb MFC after: 2 weeks
* Fix the experimental NFSv4 server so that it uses VOP_PATHCONF()rmacklem2011-04-145-21/+16
| | | | | | | | | to determine if a file system supports NFSv4 ACLs. Since VOP_PATHCONF() must be called with a locked vnode, the function is called before nfsvno_fillattr() and the result is passed in as an extra argument. MFC after: 2 weeks
* Modify the experimental NFSv4 server so that it handlesrmacklem2011-04-142-22/+22
| | | | | | | | | | | | | crossing of server mount points properly. The functions nfsvno_fillattr() and nfsv4_fillattr() were modified to take the extra arguments that are the mount point, a flag to indicate that it is a file system root and the mounted on fileno. The mount point argument needs to be busy when nfsvno_fillattr() is called, since the vp argument is not locked. Reviewed by: kib MFC after: 2 weeks
* Add some cleanup code to the module unload operation forrmacklem2011-04-101-0/+1
| | | | | | | | | | the experimental NFS server, so that it doesn't leak memory when unloaded. However, unloading the NFSv4 server is not recommended, since all NFSv4 state will be lost by the unload and clients will have to recover the state after a server reload/restart as if the server crashed/rebooted. MFC after: 2 weeks
* Quick fix to a comment.gnn2011-01-271-2/+2
|
* Fix the experimental NFSv4 server so that it uses VOP_ACCESSX()rmacklem2011-01-181-1/+1
| | | | | | to check for VREAD_ACL instead of VOP_ACCESS(). MFC after: 3 days
OpenPOWER on IntegriCloud