summaryrefslogtreecommitdiffstats
path: root/sys/fs
Commit message (Collapse)AuthorAgeFilesLines
* 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)
* In ncl_printf(), call vprintf() instead of printf().ru2011-05-041-1/+1
| | | | MFC after: 3 days
* 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
* Clarify the comment.kib2011-04-301-1/+2
| | | | MFC after: 1 week
* The build was broken by r221190 for 64bit arches like amd64.rmacklem2011-04-291-2/+3
| | | | | | This patch fixes it. MFC after: 2 weeks
* Fix the new NFS client so that it handles the "nfs_args" valuermacklem2011-04-281-19/+64
| | | | | | | | | | | | in mnt_optnew. This is needed so that the old mount(2) syscall works and that is needed so that amd(8) works. The code was basically just cribbed from sys/nfsclient/nfs_vfsops.c with minor changes. This patch is mainly to fix the new NFS client so that amd(8) works with it. Thanks go to Craig Rodrigues for helping with this. Tested by: Craig Rodrigues (for amd) MFC after: 2 weeks
* Update a comment since ext2fs does not use SU.jhb2011-04-281-3/+3
| | | | Reviewed by: kib
* The b_dep field of buffers is always empty for ext2fs, it is only usedjhb2011-04-281-6/+3
| | | | | | for SU in FFS. Reported by: kib
* Sync with several changes in UFS/FFS:jhb2011-04-287-68/+167
| | | | | | | | | | | | | | | | | | | | | - 77115: Implement support for O_DIRECT. - 98425: Fix a performance issue introduced in 70131 that was causing reads before writes even when writing full blocks. - 98658: Rename the BALLOC flags from B_* to BA_* to avoid confusion with the struct buf B_ flags. - 100344: Merge the BA_ and IO_ flags so so that they may both be used in the same flags word. This merger is possible by assigning the IO_ flags to the low sixteen bits and the BA_ flags the high sixteen bits. - 105422: Fix a file-rewrite performance case. - 129545: Implement IO_INVAL in VOP_WRITE() by marking the buffer as "no cache". - Readd the DOINGASYNC() macro and use it to control asynchronous writes. Change i-node updates to honor DOINGASYNC() instead of always being synchronous. - Use a PRIV_VFS_RETAINSUGID check instead of checking cr_uid against 0 directly when deciding whether or not to clear suid and sgid bits. Submitted by: Pedro F. Giffuni giffunip at yahoo
* Fix module names and dependencies so the NFS clients willrmacklem2011-04-271-1/+5
| | | | load correctly as modules after r221124.
* Use a private EXT2_ROOTINO constant instead of redefining ROOTINO.jhb2011-04-274-9/+9
| | | | Submitted by: Pedro F. Giffuni giffunip at yahoo
* Various style fixes including using uint*_t instead of u_int*_t.jhb2011-04-275-105/+116
| | | | Submitted by: Pedro F. Giffuni giffunip at yahoo
* This patch changes head so that the default NFS client is now the newrmacklem2011-04-271-1/+1
| | | | | | | | | | | | | | NFS client (which I guess is no longer experimental). The fstype "newnfs" is now "nfs" and the regular/old NFS client is now fstype "oldnfs". Although mounts via fstype "nfs" will usually work without userland changes, an updated mount_nfs(8) binary is needed for kernels built with "options NFSCL" but not "options NFSCLIENT". Updated mount_nfs(8) and mount(8) binaries are needed to do mounts for fstype "oldnfs". The GENERIC kernel configs have been changed to use options NFSCL and NFSD (the new client and server) instead of NFSCLIENT and NFSSERVER. For kernels being used on diskless NFS root systems, "options NFSCL" must be in the kernel config. Discussed on freebsd-fs@.
* Fix a kernel linking problem introduced by r221032, r221040rmacklem2011-04-261-3/+10
| | | | | | | | | | when building kernels that don't have "options NFS_ROOT" specified. I plan on moving the functions that use these data structures into the shared code in sys/nfs/nfs_diskless.c in a future commit. At that time, these definitions will no longer be needed in nfs_vfsops.c and nfs_clvfsops.c. MFC after: 2 weeks
* Modify the experimental (newnfs) NFS client so that it uses thermacklem2011-04-254-147/+30
| | | | | | | | 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
* Fix the experimental NFS client so that it does not boguslyrmacklem2011-04-251-1/+0
| | | | | | | | set the f_flags field of "struct statfs". This had the interesting effect of making the NFSv4 mounts "disappear" after r221014, since NFSMNT_NFSV4 and MNT_IGNORE became the same bit. MFC after: 2 weeks
* Modify the experimental NFS client so that it uses the samermacklem2011-04-253-129/+32
| | | | | | | | | | | | | | "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
* Remove the nm_mtx mutex locking from the test forrmacklem2011-04-211-5/+1
| | | | | | | | | | | | | nm_maxfilesize. This value rarely, if ever, changes and the nm_mtx mutex is locked/unlocked earlier in the function, which should be sufficient to avoid getting a stale cached value for it. There is a discussion w.r.t. what these tests should be, but I've left them basically the same as the regular NFS client for now. Suggested by: pjd MFC after: 2 weeks
* Revert r220906, since the vp isn't always locked whenrmacklem2011-04-211-2/+0
| | | | | nfscl_request() is called. It will need a more involved patch.
* Add a check for VI_DOOMED at the beginning of nfscl_request()rmacklem2011-04-201-0/+2
| | | | | | | | | so that it won't try and use vp->v_mount to do an RPC during a forced dismount. There needs to be at least one more kernel commit, plus a change to the umount(8) command before forced dismounts will work for the experimental NFS client. MFC after: 2 weeks
* Modify the offset + size checks for read and write in thermacklem2011-04-201-3/+13
| | | | | | | | | experimental NFS client to take care of overflows for the calls above the buffer cache layer in a manner similar to r220876. Thanks go to dillon at apollo.backplane.com for providing the snippet of code that does this. MFC after: 2 weeks
* Modify the offset + size checks for read and write in thermacklem2011-04-201-3/+6
| | | | | | | | experimental NFS client to take care of overflows. Thanks go to dillon at apollo.backplane.com for providing the snippet of code that does this. MFC after: 2 weeks
* Fix up handling of the nfsmount structure in read and writermacklem2011-04-191-11/+11
| | | | | | | | | within the experimental NFS client. Mostly add mutex locking and use the same rsize, wsize during the operation by keeping a local copy of it. This is another change that brings it closer to the regular NFS client. MFC after: 2 weeks
* Revert r220761 since, as kib@ pointed out, the case ofrmacklem2011-04-183-13/+0
| | | | | | | | adding the check to nfsrpc_close() isn't useful. Also, the check in nfscl_getcl() must be more involved, since it needs to check before and after the acquisition of the refcnt on nfsc_lock, while the mutex that protects the client state data is held.
* Add a vput() to nfs_lookitup() in the experimental NFS clientrmacklem2011-04-181-1/+4
| | | | | | | | | | | for a case that will probably never happen. It can only happen if a server were to successfully lookup a file, but not return attributes for that file. Although technically allowed by the NFSv3 RFC, I doubt any server would ever do this. However, if it did, the client would have not vput()'d the new vnode when it needed to do so. MFC after: 2 weeks
* Add vput() calls in two places in the experimental NFS clientrmacklem2011-04-181-2/+5
| | | | | | | | that would be needed if, in the future, nfscl_loadattrcache() were to return an error. Currently nfscl_loadattrcache() never returns an error, so these cases never currently happen. MFC after: 2 weeks
OpenPOWER on IntegriCloud