aboutsummaryrefslogtreecommitdiff
path: root/sys/nfsclient
Commit message (Collapse)AuthorAgeFilesLines
* MFC: nfs_socket.c 1.148Stephan Uphoff2007-11-161-2/+8
| | | | | | | | | | Log: NetApp filers return corrupt post op attrs in the wcc on NFS error responses. This is easy to reproduce for EROFS. I am not sure if the attrs can be corrupt for other NFS error responses. For now, disabling wcc pre-op attr checks and post-op attr loads on NFS errors (sysctl'ed). Notes: svn path=/stable/6/; revision=173680
* MFC: consolidate parsing of nfs root mount options in one placeSam Leffler2007-10-304-51/+77
| | | | | | | and handle all options; this enables things like TCP mounts Notes: svn path=/stable/6/; revision=173165
* MFC: Add a -z flag to nfsstat which zeros the NFS statistics afterJohn Baldwin2007-10-261-1/+1
| | | | | | | displaying them. Notes: svn path=/stable/6/; revision=173045
* MFC: Fix for a race where out of order loading of NFS attrs into theJohn Baldwin2007-10-171-1/+17
| | | | | | | nfsnode could lead to attrs being stale. Notes: svn path=/stable/6/; revision=172724
* MFC 1.164: Fix up NFS client write error handling.John Baldwin2007-07-171-0/+15
| | | | | | | Submitted by: mohans Notes: svn path=/stable/6/; revision=171478
* MFC 1.131: Fix for a race between the thread transmitting the request andJohn Baldwin2007-06-281-1/+5
| | | | | | | the thread processing the reply. Notes: svn path=/stable/6/; revision=171071
* MFC:Konstantin Belousov2007-06-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | rev. 1.11 of src/sys/geom/geom_vfs.c rev. 1.516 of src/sys/kern/vfs_bio.c rev. 1.35 of src/sys/nfs4client/nfs4_vnops.c rev. 1.272 of src/sys/nfsclient/nfs_vnops.c rev. 1.195 of src/sys/sys/buf.h rev. 1.18 of src/sys/sys/bufobj.h rev. 1.73 of src/sys/ufs/ffs/ffs_extern.h rev. 1.133 of src/sys/ufs/ffs/ffs_snapshot.c rev. 1.324 of src/sys/ufs/ffs/ffs_vfsops.c Avoid dealing with buffers in bdwrite() that are from other side of snaplock divisor in the lock order then the buffer being written. Add new BOP, bop_bdwrite(), to do dirty buffer flushing for same vnode in the bdwrite(). Default implementation, bufbdflush(), refactors the code from bdwrite(). For ffs device buffers, specialized implementation is used. This commit changes KPI/KBI, thus recompilation of out of tree kernel modules is required. Approved by: re (kensmith) Notes: svn path=/stable/6/; revision=170553
* MFC 1.139: Fix a snafu in the changes in 1.138.John Baldwin2007-06-081-1/+0
| | | | | | | | PR: kern/113387 Submitted by: Andre Albsmeier Notes: svn path=/stable/6/; revision=170438
* MFC: Various fixes to NFS DirectIO support.John Baldwin2007-05-022-7/+13
| | | | Notes: svn path=/stable/6/; revision=169210
* MFC: Don't hold the vnode interlock across a tsleep() in nfs_flush().John Baldwin2007-04-251-2/+3
| | | | | | | | | | | This was actually contained in the MPSAFE NFS client changes which is not all being MFC'd, however, this fixes a bug in the previous fix to nfs_flush(). Guidance from: mohans Notes: svn path=/stable/6/; revision=169045
* MFC:John Baldwin2007-04-253-5/+37
| | | | | | | | | | | - In nfs_flush(), clear the NMODIFIED bit only if there are no dirty buffers *and* there are no buffers queued up for writing. - Keep track of the number of in-progress async direct IO writes in the nfsnode. Make fsync/close wait until all of these drain. Add a check to nfs_getpage() and nfs_putpage(). Notes: svn path=/stable/6/; revision=169044
* MFC: Don't hard-code the nfs root socket as SOCK_DGRAM. This is currentlyKris Kennaway2007-03-111-1/+1
| | | | | | | a NOP in 6.x but this may change if further code is merged from 7.0. Notes: svn path=/stable/6/; revision=167459
* MFC:Mohan Srinivasan2007-02-161-8/+1
| | | | | | | | | Backing out an earlier change. It seems harmless for NFS to miss the "force unmount" flag, making the acquisition of the MNT_ILOCK in nfs_request() and nfs_sigintr() unnecessary. Pointed out by tegge@. Notes: svn path=/stable/6/; revision=166783
* MFC: Do not set B_NOCACHE on buffers when releasing them in flushbuflist().John Baldwin2007-02-121-0/+13
| | | | | | | | | | | | | | If B_NOCACHE is set the pages of vm backed buffers will be invalidated. However clean buffers can be backed by dirty VM pages so invalidating them can lead to data loss. Add support for flush dirty page in the data invalidation function of some network file systems. This fixes data losses during vnode recycling (and other code paths using invalbuf(*,V_SAVE,*,*)) for data written using an mmaped file. Notes: svn path=/stable/6/; revision=166664
* Add missing MNT_ILOCK around some mnt_kern_flag accesses.Mohan Srinivasan2007-02-111-1/+8
| | | | Notes: svn path=/stable/6/; revision=166635
* MFC:Mohan Srinivasan2007-02-115-13/+20
| | | | | | | | | | | | | | | | | | | | | | | Fixes up the handling of shared vnode lock lookups in the NFS client, adds a FS type specific flag indicating that the FS supports shared vnode lock lookups, adds some logic in vfs_lookup.c to test this flag and set lock flags appropriately. This change fixes the general problem of cascading vnode locks when an NFS server goes down. Ideally, we wouldn't need these changes, as enabling shared vnode lock lookups globally would work. Unfortunately, UFS, for example isn't ready for shared vnode lock lookups, crashing pretty quickly. This change is the result of discussions with Stephan Uphoff (ups@). Thanks to Kris for shaking out several bugs in NFS with shared vnode lock lookups in current. MFC'ed per Kris' request. Reviewed by: ups@ Notes: svn path=/stable/6/; revision=166632
* MFC: Fix for a vnode lock leak in nfs_create() in the event of an error.Mohan Srinivasan2007-01-311-0/+2
| | | | | | | Spotted by ups@. Notes: svn path=/stable/6/; revision=166379
* MFC 3 fixes from -current. All having to do with the case where the sameMohan Srinivasan2007-01-031-9/+8
| | | | | | | | | | | | | filehandle is looked up by 2 or more processes. - Don't vrele() the losing vnode, as vfs_hash_insert() vput()'s it. - Initialize mutexes on the losing nfsnode (as these get destroyed in the nfsnode reclaim path). - Move the initialization of the filehandle to before the vfs_insert, to close some races which could result in multiple vnodes for the same filehandle being inserted into the hash. Notes: svn path=/stable/6/; revision=165753
* MFC 1.67: honor nolockd flag in root mount optionsSam Leffler2006-12-231-0/+2
| | | | Notes: svn path=/stable/6/; revision=165507
* MFC :Mohan Srinivasan2006-12-051-0/+2
| | | | | | | | | | Fix to readdir+ reply handling. When inserting an entry into the namecache, initialize the nfsnode's ctime. Otherwise a subsequent lookup purges the just entered namecache entry. Approved by: re Notes: svn path=/stable/6/; revision=164919
* MFC (1.270: don't do null Setattr RPCs for VA_MARK_ATIME).Bruce Evans2006-11-231-2/+2
| | | | Notes: svn path=/stable/6/; revision=164554
* MFC: Make EWOULDBLOCK a recoverable error so that the request isMohan Srinivasan2006-11-021-2/+2
| | | | | | | | | | | retransmitted. This bug results in data corruption. Writes are silently dropped on EWOULDBLOCK (caused because socket send buffer is full and sockbuf timer fires - with NFS/TCP). Reviewed by: ups@ Approved by: re Notes: svn path=/stable/6/; revision=163920
* MFC: Use mount interlock to protect all changes to mnt_flag andTor Egge2006-10-091-2/+9
| | | | | | | | | | mnt_kern_flag. This eliminates a race where MNT_UPDATE flag could be lost when nmount() raced against sync(), sync_fsync() or quotactl(). Approved by: re (kensmith) Notes: svn path=/stable/6/; revision=163172
* MFC change 1.138.Mohan Srinivasan2006-10-011-0/+31
| | | | | | | | | | | Fix for a NFS/TCP client bug which would cause the NFS/TCP stream to get out of sync under heavy loads, forcing frequent reconnets, causing EBADRPC errors etc. Approved by: re Notes: svn path=/stable/6/; revision=162907
* MFC:Mohan Srinivasan2006-09-131-0/+5
| | | | | | | | | Vnode locks are recursive and the NFS client support shared vnode locks. Approved by: re Notes: svn path=/stable/6/; revision=162290
* MFC: rev 1.185Brooks Davis2006-09-071-0/+10
| | | | | | | | | | Add a new kernel environment variable "boot.netif.mtu" which is used to set the MTU prior to mounting root via NFS. This is required if the server supports a higher than default MTU because the client will not see the responses otherwise. Notes: svn path=/stable/6/; revision=162116
* MFC rev. 1.267:Konstantin Belousov2006-08-071-8/+2
| | | | | | | | | | | | Always supply curthread as argument to nfs_asyncio and nfs_doio in nfs_strategy. Otherwise, for some buffers, signals would be ignored at the intr mounts. Reviewed by: mohan Approved by: pjd (mentor) Notes: svn path=/stable/6/; revision=161042
* MFC rev. 1.142:Konstantin Belousov2006-08-071-1/+3
| | | | | | | | | | | Signals may be delivered to process as well as to the thread. Check the thread-delivered signals in addition to the process one. Reviewed by: mohan Approved by: pjd (mentor) Notes: svn path=/stable/6/; revision=161041
* Merge nfs_nfsiod.c:1.89 from HEAD to RELENG_6:Robert Watson2006-06-081-1/+1
| | | | | | | | | | | | | | | | | | | | Adjust minimum iod threads from 4 to 0 -- since we compile the NFS client into the kernel by default, and many users won't use NFS, don't start an extra 4 kernel threads that are unused. Once NFS becomes active, it will start nfsiod's as it needs them. We might consider mandating a minimum iod's equal to the number of active NFS mounts (truncated to some value), which would force some to remain available without having to create a new one if the file system is mostly inactive. PR: 70880 Prodded by: cel Head nod: peter Pointed out by: Joe <fbsd_user at a1poweruser dot com> Notes: svn path=/stable/6/; revision=159418
* NFS over TCP retransmit behavior should default to a 60 second time out,Chuck Lever2006-05-302-3/+9
| | | | | | | | | | | | | | | mimicing the NFS reference implementation. NFS over TCP does not need fast retransmit timeouts, since network loss and congestion are managed by the transport (TCP), unlike with NFS over UDP. A long timeout prevents the unnecessary retransmission of non- idempotent NFS requests. Reviewed by: mohans, silby, rees? Sponsored by: Network Appliance, Incorporated Notes: svn path=/stable/6/; revision=159057
* Refactor the NFS over UDP retransmit timeout estimation logic to allowChuck Lever2006-05-303-62/+158
| | | | | | | | | | | | | | | | the estimator to be more easily tuned and maintained. There should be no functional change except there is now a lower limit on the retransmit timeout to prevent the client from retransmitting faster than the server's disks can fill requests, and an upper limit to prevent the estimator from taking too long to retransmit during a server outage. Reviewed by: mohan, kris, silby Sponsored by: Network Appliance, Incorporated Notes: svn path=/stable/6/; revision=159056
* MFC src/sys/nfsclient/nfs_bio.c,v 1.154Xin LI2006-04-182-5/+4
| | | | | | | | | | | | | | | | | | | and src/sys/nfsclient/nfs_vnops.c,v 1.262 (by ps@): - Always return success from NFS strategy. nfs_doio(), in the event of an error, does the right thing, in terms of setting the error flags in the buf header. That fixes a crash from bstrategy(). - Treat ETIMEDOUT as a "recoverable" error, causing the buffer to be re-dirtied. ETIMEDOUT can occur on soft mounts, when the number of retries are exceeded, and we don't want data loss in that case. Submitted by: Mohan Srinivasan Approved by: re (scottl) Notes: svn path=/stable/6/; revision=157830
* MFC 1.261 - fix a crash when an nfsv2 mount failsJonathan Chen2006-04-181-2/+4
| | | | | | | Approved by: re Notes: svn path=/stable/6/; revision=157829
* If an NFS server returns more than a few EJUKEBOX errors for a given RPCChuck Lever2006-04-021-8/+4
| | | | | | | | | | | | | | | | | | | | request, the FreeBSD NFS client will quickly back off to a excessively long wait (days, then weeks) before retrying the request. Change the behavior of the FreeBSD NFS client to match the behavior of the reference NFS client implementation (Solaris). This provides a fixed delay of 10 seconds between each retry by default. A sysctl, called nfs3_jukebox_delay, is now available to tune the delay. Unlike Solaris, the sysctl value on FreeBSD is in seconds, rather than in HZ. MFC revision 1.136 to RELENG_6 Sponsored by: Network Appliance, Incorporated Reviewed by: rick Approved by: re (kensmith), silby Notes: svn path=/stable/6/; revision=157389
* MFC r1.137:Kris Kennaway2006-03-311-0/+1
| | | | | | | | | | | | | | | | | | | | | | | Fix a bug in the NFS/TCP retransmission path. The bug was that earlier, if a request was retransmitted, we would do subsequent retransmits every 10 msecs. This can cause data corruption under moderate loads by reordering operations as seen by the client NFS attribute cache, and on the server side when the retransmission occurs after the original request has left the duplicate cache, since the operation will be committed for a second time. Further work on retransmission handling is needed (e.g. they are still being done sent too often since they are scaled by HZ, and the size of the dup cache is too small and easily overwhelmed on busy servers). Submitted by: mohans Approved by: re (mux) Notes: svn path=/stable/6/; revision=157326
* Fix a bug in NFSv3 READDIRPLUS reply processingChuck Lever2006-03-291-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | The client's READDIRPLUS logic skips the attributes and filehandle of the ".." entry. If the server doesn't send attributes but does send a filehandle for "..", the client's logic doesn't account for the extra "value Fix a bug in NFSv3 READDIRPLUS reply processing The client's READDIRPLUS logic skips the attributes and filehandle of the ".." entry. If the server doesn't send attributes but does send a filehandle for "..", the client's logic doesn't account for the extra "value follows" field that indicates whether the filehandle is present, causing the remaining entries in the reply to be ignored. This is an MFC of 1.264 in the CURRENT branch. Sponsored by: Network Appliance, Inc. Reviewed by: rick, mohans Approved by: re, silby Notes: svn path=/stable/6/; revision=157265
* MFC 1.263: a typo fix (diff reduction against -HEAD)Xin LI2006-03-241-1/+1
| | | | | | | Approved by: re (hrs) Notes: svn path=/stable/6/; revision=157080
* MFC: sys/nfsclient/nfs_diskless.c 1.15Pawel Jakub Dawidek2006-03-201-1/+1
| | | | | | | | | I wanted 'nolockd' here instead of 'lockd'. Approved by: re (mux) Notes: svn path=/stable/6/; revision=156909
* MFC: Call vfs_destroy_object() before v_data gets set to NULL.Scott Long2006-03-121-1/+5
| | | | | | | Approved by: re Notes: svn path=/stable/6/; revision=156603
* MFC: sys/nfsclient/nfs_diskless.c 1.12,1.13Pawel Jakub Dawidek2006-03-011-0/+29
| | | | | | | | | | | | | | | | | | | | | Add boot.nfsroot.options loader tunable. It allows to specify options for NFS root file system. Currently supported options are: soft, intr, conn, lockd. I'm adding this functionality mostly for 'lockd' option, which is only honored when performing the initial mount and will be silently ignored if used while updating the mount options. This will allow to use flock(2) without the need of using varmfs or rpc.lockd and friends. Example of use: boot.nfsroot.options="intr,lockd" Approved by: re (scottl) Notes: svn path=/stable/6/; revision=156164
* Work around the shortness of the size argument toYaroslav Tykhiy2006-02-201-1/+1
| | | | | | | | | | | | | | | | | | | vnode_create_vobject() while preserving the binary ABI to filesystem modules in RELENG_6: introduce a new function vnode_create_vobject_off() that takes the size argument as off_t; move all stock file systems to it; re-implement the old vnode_create_vobject() using vnode_create_vobject_off() so that old or binary-only FS modules can work w/o hitting the bug. The trick is to pass a size of 0 to vnode_create_vobject_off() so that it will call VOP_GETATTR() and thus get the actual, untruncated file size even if the calling module still uses the old vnode_create_vobject(). PR: kern/92243 Approved by: re (scottl) Notes: svn path=/stable/6/; revision=155853
* MFC rev 1.135:Jim Rees2006-02-161-2/+2
| | | | | | | | | | Don't log an error on tcp connection reset, even if we don't get ECONNRESET. Submitted by: cel@citi.umich.edu Approved by: re (scottl) Notes: svn path=/stable/6/; revision=155746
* Merge nfs_lock.c:1.43 from HEAD to RELENG_6:Robert Watson2006-02-141-4/+1
| | | | | | | | | | In nfs_dolock(), GC now under-used ioflg, rendered obsolete when we moved from using a fifo to talk to rpc.lockd to using a special device node. Approved by: re (scottl) Notes: svn path=/stable/6/; revision=155631
* MFC: Add marker vnodes to ensure that all vnodes associated with the mountTor Egge2006-01-141-2/+3
| | | | | | | point are iterated over when using MNT_VNODE_FOREACH. Notes: svn path=/stable/6/; revision=154332
* MFC rev. 1.134: fix for a bug where NFS/TCP wouldMaxim Konovalov2005-12-151-1/+1
| | | | | | | | | | | not reconnect (in the case where the server FIN'ed). PR: kern/88833 Requested by: Roman V. Palagin Approved by: Mohan Strinivasan Notes: svn path=/stable/6/; revision=153454
* MFC: nfs_socket.c 1.132, nfs_subs.c 1.142, nfsm_subs.h 1.37Jim Rees2005-12-133-7/+13
| | | | | | | fix a problem with XID re-use when a server returns NFSERR_JUKEBOX. Notes: svn path=/stable/6/; revision=153387
* MFC 1.260 (by ps): Fixed a panic that can happen when nfs_lookup() hitsXin LI2005-11-251-1/+1
| | | | | | | | | an error. RELENG_6_0 errata candidate. Notes: svn path=/stable/6/; revision=152788
* MFC:Gleb Smirnoff2005-10-272-3/+15
| | | | | | | | | | | | | - Fix leak of struct nlminfo on process exit. - Fix malloc type collision, that made the above problem difficult to understand. Reported by: Vladimir Sharun <sharun ukr.net> Approved by: re (scottl) Notes: svn path=/stable/6/; revision=151755
* MFC (by ps):Xin LI2005-10-091-1/+2
| | | | | | | | | | | | | | | | | | | | | | Fixes for NFS crashes on architectures that require strict alignment. | - Fix nfsm_disct() so that after pulling up data, the remaining data | is aligned if necessary. | - Fix nfs_clnt_tcp_soupcall() to bcopy() the rpc length out of the | mbuf (instead of casting m_data to a uint32). | | Submitted by: Pyun YongHyeon | Reviewed by: Mohan Srinivasan | | Revision Changes Path | 1.118 +12 -3 src/sys/nfs/nfs_common.c | 1.38 +6 -0 src/sys/nfs/nfs_common.h | 1.126 +2 -1 src/sys/nfsclient/nfs_socket.c Approved by: re (scottl) Notes: svn path=/stable/6/; revision=151122
* MFC (by ps)Xin LI2005-10-091-1/+2
| | | | | | | | | | | | | | | | | | In nfs_nget() if two threads race on the same filehandle, the loser | should cause the nfsnode to get freed. This fixes a potential vnode | (and nfsnode) leak in that path. | | Submitted by: Mohan Srinivasan | Reviewed by: phk | | Revision Changes Path | 1.78 +2 -1 src/sys/nfsclient/nfs_node.c Approved by: re (scottl) Notes: svn path=/stable/6/; revision=151120