summaryrefslogtreecommitdiffstats
path: root/sys/fs/nfs
Commit message (Collapse)AuthorAgeFilesLines
* Add a flag to the experimental NFSv4 client to indicate whenrmacklem2010-10-261-0/+1
| | | | | | | | | | | | | 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-231-1/+1
| | | | | | | | | | | 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-222-1/+2
| | | | | | | | 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
* Fix the NFSVNO_CMPFH() macro in the experimental NFS server sormacklem2010-09-101-2/+1
| | | | | | | | | | | that it works correctly for ZFS file handles. It is possible to have two ZFS file handles that differ only in the bytes in the fid_reserved field of the generic "struct fid" and comparing the bytes in fid_data didn't catch this case. This patch changes the macro to compare all bytes of "struct fid". Tested by: gull at gull.us MFC after: 2 weeks
* The timer routine in the experimental NFS server did not acquirermacklem2010-08-282-0/+16
| | | | | | | | | | | | the correct mutex when checking nfsv4root_lock. Although this could be fixed by adding mutex lock/unlock calls, zack.kirsch at isilon.com suggested a better fix that uses a non-blocking acquisition of a reference count on nfsv4root_lock. This fix allows the weird NFSLOCKSTATE(); NFSUNLOCKSTATE(); synchronization to be deleted. This patch applies this fix. Tested by: zack.kirsch at isilon.com MFC after: 2 weeks
* Modify the return value for nfscl_mustflush() from boolean_t,rmacklem2010-08-031-1/+1
| | | | | | | | which I mistakenly thought was correct w.r.t. style(9), back to int and add the checks for != 0. This is just a stylistic modification. MFC after: 1 week
* For the experimental NFSv4 server's dumplocks operation, add thermacklem2010-07-191-1/+2
| | | | | | | | | MPSAFE flag to cn_flags so that it doesn't panic. The panics weren't seen since nfsdumpstate(8) is broken for the "-l" case, so this was never done. I'll do a separate commit to fix nfsdumpstate(8). Submitted by: zack.kirsch at isilon.com MFC after: 2 weeks
* Change the nfscl_mustflush() function in the experimental NFSv4rmacklem2010-07-181-1/+1
| | | | | | | client to return a boolean_t in order to make it more compatible with style(9). MFC after: 2 weeks
* Fix typos in macros.rmacklem2010-05-082-4/+4
| | | | | | PR: kern/146375 Submitted by: simon AT comsys.ntu-kpi.kiev.ua MFC after: 1 week
* Patch the experimental NFS client so that it works for NFSv2rmacklem2010-05-081-2/+34
| | | | | | | by adding the necessary mapping from NFSv3 procedure numbers to NFSv2 procedure numbers when doing NFSv2 RPCs. MFC after: 1 week
* An NFSv4 server will reply NFSERR_GRACE for non-recovery RPCsrmacklem2010-04-244-9/+13
| | | | | | | | | | | | during the grace period after startup. This grace period must be at least the lease duration, which is typically 1-2 minutes. It seems prudent for the experimental NFS client to wait a few seconds before retrying such an RPC, so that the server isn't flooded with non-recovery RPCs during recovery. This patch adds an argument to nfs_catnap() to implement a 5 second delay for this case. MFC after: 1 week
* When the experimental NFS client is handling an NFSv4 server rebootrmacklem2010-04-221-2/+2
| | | | | | | | | | | | with delegations enabled, the recovery could fail if the renew thread is trying to return a delegation, since it will not do the recovery. This patch fixes the above by having nfscl_recalldeleg() fail with the I/O operations returning EIO, so that they will be attempted later. Most of the patch consists of adding an argument to various functions to indicate the delegation recall case where this needs to be done. MFC after: 1 week
* Avoid extraneous recovery cycles in the experimental NFS clientrmacklem2010-04-181-0/+1
| | | | | | | | | | | | | | when an NFSv4 server reboots, by doing two things. 1 - Make the function that acquires a stateid for I/O operations block until recovery is complete, so that it doesn't acquire out of date stateids. 2 - Only allow a recovery once every 1/2 of a lease duration, since the NFSv4 server must provide a recovery grace period of at least a lease duration. This should avoid recoveries caused by an out of date stateid that was acquired for an I/O op. just before a recovery cycle started. MFC after: 1 week
* The experimental NFS client was not filling in recovery credentialsrmacklem2010-04-152-0/+3
| | | | | | | | | | | for opens done locally in the client when a delegation for the file was held. This could cause the client to crash in crsetgroups() when recovering from a server crash/reboot. This patch fills in the recovery credentials for this case, in order to avoid the client crash. Also, add KASSERT()s to the credential copy functions, to catch any other cases where the credentials aren't filled in correctly. MFC after: 1 week
* This patch should fix handling of byte range locks locallyrmacklem2010-03-305-2/+38
| | | | | | | | | | | on the server for the experimental nfs server. When enabled by setting vfs.newnfs.locallocks_enable to non-zero, the experimental nfs server will now acquire byte range locks on the file on behalf of NFSv4 clients, such that lock conflicts between the NFSv4 clients and processes running locally on the server, will be recognized and handled correctly. MFC after: 2 weeks
* Fix the experimental NFS subsystem so that it uses the correctrmacklem2010-03-241-3/+3
| | | | | | | preprocessor macro name for not requiring strict data alignment. Suggested by: marius MFC after: 2 weeks
* Modify the experimental server so that it uses VOP_ACCESSX().rmacklem2009-12-252-68/+2
| | | | | | | | | | This is necessary in order to enable NFSv4 ACL support. The argument to nfsvno_accchk() was changed to an accmode_t and the function nfsrv_aclaccess() was no longer needed and, therefore, deleted. Reviewed by: trasz MFC after: 2 weeks
* Remove unneeded ifdefs.trasz2009-12-035-225/+5
| | | | Reviewed by: rmacklem
* Patch the experimental NFS server is a manner analagous tormacklem2009-11-201-2/+2
| | | | | | | | | | | | | r197525, so that the creation verifier is handled correctly in va_atime for 64bit architectures. There were two problems. One was that the code incorrectly assumed that sizeof (struct timespec) == 8 and the other was that the tv_sec field needs to be assigned from a signed 32bit integer, so that sign extension occurs on 64bit architectures. This is required for correct operation when exporting ZFS volumes. Reviewed by: pjd MFC after: 2 weeks
* Fix typo in the comment.trasz2009-09-301-1/+1
|
* Merge the remainder of kern_vimage.c and vimage.h into vnet.c andrwatson2009-08-011-1/+0
| | | | | | | | | | vnet.h, we now use jails (rather than vimages) as the abstraction for virtualization management, and what remained was specific to virtual network stacks. Minor cleanups are done in the process, and comments updated to reflect these changes. Reviewed by: bz Approved by: re (vimage blanket)
* Add changes to the experimental nfs client to use the PBDRY flag forrmacklem2009-07-221-0/+7
| | | | | | | | msleep(9) when a vnode lock or similar may be held. The changes are just a clone of the changes applied to the regular nfs client by r195703. Approved by: re (kensmith), kib (mentor)
* Build on Jeff Roberson's linker-set based dynamic per-CPU allocatorrwatson2009-07-141-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (DPCPU), as suggested by Peter Wemm, and implement a new per-virtual network stack memory allocator. Modify vnet to use the allocator instead of monolithic global container structures (vinet, ...). This change solves many binary compatibility problems associated with VIMAGE, and restores ELF symbols for virtualized global variables. Each virtualized global variable exists as a "reference copy", and also once per virtual network stack. Virtualized global variables are tagged at compile-time, placing the in a special linker set, which is loaded into a contiguous region of kernel memory. Virtualized global variables in the base kernel are linked as normal, but those in modules are copied and relocated to a reserved portion of the kernel's vnet region with the help of a the kernel linker. Virtualized global variables exist in per-vnet memory set up when the network stack instance is created, and are initialized statically from the reference copy. Run-time access occurs via an accessor macro, which converts from the current vnet and requested symbol to a per-vnet address. When "options VIMAGE" is not compiled into the kernel, normal global ELF symbols will be used instead and indirection is avoided. This change restores static initialization for network stack global variables, restores support for non-global symbols and types, eliminates the need for many subsystem constructors, eliminates large per-subsystem structures that caused many binary compatibility issues both for monitoring applications (netstat) and kernel modules, removes the per-function INIT_VNET_*() macros throughout the stack, eliminates the need for vnet_symmap ksym(2) munging, and eliminates duplicate definitions of virtualized globals under VIMAGE_GLOBALS. Bump __FreeBSD_version and update UPDATING. Portions submitted by: bz Reviewed by: bz, zec Discussed with: gnn, jamie, jeff, jhb, julian, sam Suggested by: peter Approved by: re (kensmith)
* Add calls to the experimental nfs client for the case of an "intr" mount,rmacklem2009-07-121-1/+16
| | | | | | | so that signals that aren't supposed to terminate RPCs in progress are masked off during the RPC. Approved by: re (kensmith), kib (mentor)
* Since the nfscl_getclose() function both decremented open counts and,rmacklem2009-07-091-1/+3
| | | | | | | | | | | | | optionally, created a separate list of NFSv4 opens to be closed, it was possible for the associated OpenOwner to be free'd before the Open was closed. The problem was that the Open was taken off the OpenOwner list before the Close RPC was done and OpenOwners can be free'd once the list is empty. This patch separates out the case of doing the Close RPC into a separate function called nfscl_doclose() and simplifies nfsrpc_doclose() so that it closes a single open instead of a list of them. This avoids removing the Open from the OpenOwner list before doing the Close RPC. Approved by: re (kensmith), kib (mentor)
* Replace RPCAUTH_UNIXGIDS with NFS_MAXGRPS so that nfscbd.c will build.rmacklem2009-06-201-2/+2
| | | | Approved by: kib (mentor)
* Change the size of the nfsc_groups[] array in the experimental nfsrmacklem2009-06-201-4/+4
| | | | | | | | client to RPCAUTH_UNIXGIDS + 1 (17), since that is what can go on the wire for AUTH_SYS authentication. Reviewed by: brooks Approved by: kib (mentor)
* Rework the credential code to support larger values of NGROUPS andbrooks2009-06-191-6/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NGROUPS_MAX, eliminate ABI dependencies on them, and raise the to 1024 and 1023 respectively. (Previously they were equal, but under a close reading of POSIX, NGROUPS_MAX was defined to be too large by 1 since it is the number of supplemental groups, not total number of groups.) The bulk of the change consists of converting the struct ucred member cr_groups from a static array to a pointer. Do the equivalent in kinfo_proc. Introduce new interfaces crcopysafe() and crsetgroups() for duplicating a process credential before modifying it and for setting group lists respectively. Both interfaces take care for the details of allocating groups array. crsetgroups() takes care of truncating the group list to the current maximum (NGROUPS) if necessary. In the future, crsetgroups() may be responsible for insuring invariants such as sorting the supplemental groups to allow groupmember() to be implemented as a binary search. Because we can not change struct xucred without breaking application ABIs, we leave it alone and introduce a new XU_NGROUPS value which is always 16 and is to be used or NGRPS as appropriate for things such as NFS which need to use no more than 16 groups. When feasible, truncate the group list rather than generating an error. Minor changes: - Reduce the number of hand rolled versions of groupmember(). - Do not assign to both cr_gid and cr_groups[0]. - Modify ipfw to cache ucreds instead of part of their contents since they are immutable once referenced by more than one entity. Submitted by: Isilon Systems (initial implementation) X-MFC after: never PR: bin/113398 kern/133867
* Add the explicit include of vimage.h to another five .c files stillbz2009-06-171-0/+1
| | | | | | | missing it. Remove the "hidden" kernel only include of vimage.h from ip_var.h added with the very first Vimage commit r181803 to avoid further kernel poisoning.
* Remove the "int *" typecast for the aresid argument to vn_rdwr()rmacklem2009-06-161-1/+1
| | | | | | | | and change the type of the argument from size_t to int. This should avoid issues on 64bit architectures. Suggested by: kib Approved by: kib (mentor)
* Don't check MAC in the NFS server ACL set path, right now we aren'trwatson2009-06-051-4/+0
| | | | enforcing MAC for NFS clients.
* Place hostnames and similar information fully under the prison system.jamie2009-05-291-0/+1
| | | | | | | | | | | | | | | | | The system hostname is now stored in prison0, and the global variable "hostname" has been removed, as has the hostname_mtx mutex. Jails may have their own host information, or they may inherit it from the parent/system. The proper way to read the hostname is via getcredhostname(), which will copy either the hostname associated with the passed cred, or the system hostname if you pass NULL. The system hostname can still be accessed directly (and without locking) at prison0.pr_host, but that should be avoided where possible. The "similar information" referred to is domainname, hostid, and hostuuid, which have also become prison parameters and had their associated global variables removed. Approved by: bz (mentor)
* Add a function to the experimental nfs subsystem that tests to seermacklem2009-05-272-1/+24
| | | | | | | | if a local file system supports NFSv4 ACLs. This allows the NFSHASNFS4ACL() macro to be correctly implemented. The NFSv4 ACL support should now work when the server exports a ZFS volume. Approved by: kib (mentor)
* Fix the experimental nfs subsystem so that it builds with thermacklem2009-05-263-7/+5
| | | | | | | | current NFSv4 ACLs, as defined in sys/acl.h. It still needs a way to test a mount point for NFSv4 ACL support before it will work. Until then, the NFSHASNFS4ACL() macro just always returns 0. Approved by: kib (mentor)
* Adapt to the new ACL #define names.trasz2009-05-261-13/+13
| | | | Reviewed by: rmacklem@
* Fix the handling of NFSv4 Illegal Operation number to conformrmacklem2009-05-261-0/+3
| | | | | | | to RFC3530 (the operation number in the reply must be set to the value for OP_ILLEGAL). Also cleaned up some indentation. Approved by: kib (mentor)
* Temporarily #undef NFS4_ACL_EXTATTR_NAME, so that thermacklem2009-05-241-0/+2
| | | | | | | experimental nfs subsystem will build while the NFSv4 ACL support is going into the kernel. Approved by: kib (mentor)
* Crib the realign function out of nfs_krpc.c and add a callrmacklem2009-05-242-26/+40
| | | | | | | | to it for the client side reply. Hopefully this fixes the problem with using the new krpc for arm for the experimental nfs client. Approved by: kib (mentor)
* Fix the experimental nfsv4 client so that it works for thermacklem2009-05-241-12/+39
| | | | | | | | | | case of a kerberized mount without a host based principal name. This will only work for mounts being done by a user other than root. Support for a host based principal name will not work until proposed changes to the rpcsec_gss part of the krpc are committed. It now builds for "options KGSSAPI". Approved by: kib (mentor)
* Fix the rpc_gss_secfind() call in nfs_commonkrpc.c so thatrmacklem2009-05-231-1/+16
| | | | | | | | | | | the code will build when "options KGSSAPI" is specified without requiring the proposed changes that add host based initiator principal support. It will not handle the case where the client uses a host based initiator principal until those changes are committed. The code that uses those changes is #ifdef'd notyet until the krpc rpcsec_changes are committed. Approved by: kib (mentor)
* Fix the comment in sys/fs/nfs/nfs.h to correctly reflect thermacklem2009-05-221-1/+1
| | | | | | | current use of the R_xxx flags. This changed when the NFS_LEGACYRPC code was removed from the subsystem. Approved by: kib (mentor)
* Remove the unmaintained University of Michigan NFSv4 client from 8.xrwatson2009-05-222-2/+0
| | | | | | | prior to 8.0-RELEASE. Rick Macklem's new and more feature-rich NFSv234 client and server are replacing it. Discussed with: rmacklem
* Change the experimental NFSv4 client so that it does not dormacklem2009-05-181-3/+2
| | | | | | | | | the NFSv4 Close operations until ncl_inactive(). This is necessary so that the Open StateIDs are available for doing I/O on mmap'd files after VOP_CLOSE(). I also changed some indentation for the nfscl_getclose() function. Approved by: kib (mentor)
* Fixed the Null callback RPCs so that they work with the new krpc. Thisrmacklem2009-05-161-9/+10
| | | | | | | required two changes: setting the program and version numbers before connect and fixing the handling of the Null Rpc case in newnfs_request(). Approved by: kib (mentor)
* Move the nfsstat structure and proc/op number definitions on thermacklem2009-05-153-152/+177
| | | | | | | | | experimental nfs subsystem from sys/fs/nfs/nfs.h and sys/fs/nfs/nfsproto.h to sys/fs/nfs/nfsport.h and rename nfsstat to ext_nfsstat. This was done so that src/usr.bin/nfsstat.c could use it alongside the regular nfs include files and struct nfsstat. Approved by: kib (mentor)
* Apply changes to the experimental nfs server so that it uses the securityrmacklem2009-05-144-17/+11
| | | | | | | flavors as exported in FreeBSD-CURRENT. This allows it to use a slightly modified mountd.c instead of a different utility. Approved by: kib (mentor)
* Change the file names in the comments in sys/fs/nfs/nfs_var.h sormacklem2009-05-141-34/+30
| | | | | | | that they are the names used in FreeBSD-CURRENT. Also shuffled a few entries around, so that they under the correct comment. Approved by: kib (mentor)
* Change the name of the nfs server addsock structure from nfsd_argsrmacklem2009-05-111-1/+1
| | | | | | | to nfsd_addsock_args, so that it is consistent with the one in sys/nfsserver/nfs.h. Approved by: kib (mentor)
* Remove the thread argument from the FSD (File-System Dependent) parts ofattilio2009-05-112-9/+9
| | | | | | | | | | | | | | | | | the VFS. Now all the VFS_* functions and relating parts don't want the context as long as it always refers to curthread. In some points, in particular when dealing with VOPs and functions living in the same namespace (eg. vflush) which still need to be converted, pass curthread explicitly in order to retain the old behaviour. Such loose ends will be fixed ASAP. While here fix a bug: now, UFS_EXTATTR can be compiled alone without the UFS_EXTATTR_AUTOSTART option. VFS KPI is heavilly changed by this commit so thirdy parts modules needs to be recompiled. Bump __FreeBSD_version in order to signal such situation.
* Do not embed struct ucred into larger netcred parent structures.kan2009-05-091-10/+0
| | | | | | | | | | | | | Credential might need to hang around longer than its parent and be used outside of mnt_explock scope controlling netcred lifetime. Use separate reference-counted ucred allocated separately instead. While there, extend mnt_explock coverage in vfs_stdexpcheck and clean-up some unused declarations in new NFS code. Reported by: John Hickey PR: kern/133439 Reviewed by: dfr, kib
OpenPOWER on IntegriCloud