summaryrefslogtreecommitdiffstats
path: root/sys/nfsclient
Commit message (Collapse)AuthorAgeFilesLines
...
* Refactor the NFS over UDP retransmit timeout estimation logic to allowcel2006-05-233-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 to long to retransmit during a server outage. Reviewed by: mohan, kris, silby Sponsored by: Network Appliance, Incorporated
* Vnode locks are recursive and the NFS client support shared vnode locks.mohans2006-05-231-0/+5
| | | | Found by: Kris Kennaway.
* Changes to make the NFS client MP safe.mohans2006-05-1910-450/+919
| | | | Thanks to Kris Kennaway for testing and sending lots of bugs my way.
* Fix a snafu caused while patching the previous fix from another branch.mohans2006-05-051-1/+0
|
* Fix for a NFS/TCP client bug which would cause the NFS/TCP stream to getmohans2006-05-051-0/+31
| | | | | out of sync under heavy loads, forcing frequent reconnets, causing EBADRPC errors etc.
* Keep track of the number of in-progress async direct IO writes in the nfsnode.mohans2006-04-063-5/+36
| | | | | Make fsync/close wait until all of these drain. Add a check to nfs_getpage() and nfs_putpage().
* - Busy the filesystem in nfs_statfs to prevent us from creating a newjeff2006-04-011-1/+7
| | | | | | | | | vnode after vflush() has succeeded. This would cause a dangling vnode panic at unmount time otherwise. Other filesystems may have this problem via their VFS_VGET() routines. Found by: kris Sponsored by: Isilon Systems, Inc.
* Fix a bug in the NFS/TCP retransmission path.kris2006-03-231-0/+1
| | | | | | | | | | | | | | | | | 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
* Actually I wanted 'nolockd' here instead of 'lockd'.pjd2006-03-191-1/+1
| | | | MFC after: 2 days
* If an NFS server returns more than a few EJUKEBOX errors for a given RPCcel2006-03-171-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. Sponsored by: Network Appliance, Incorporated Reviewed by: rick Approved by: silby MFC after: 3 days
* Fix a bug in NFSv3 READDIRPLUS reply processingcel2006-03-081-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 follows" field that indicates whether the filehandle is present, causing the remaining entries in the reply to be ignored. Sponsored by: Network Appliance, Inc. Reviewed by: rick, mohans Approved by: silby MFC after: 2 weeks
* Don't log an error on tcp connection reset, even if we don't get ECONNRESET.rees2006-01-201-2/+2
| | | | Submitted by: cel@citi.umich.edu
* I ran into an nfs client panic a couple of times in a row over thealfred2006-01-171-1/+5
| | | | | | | | | | | | | | | | | | | | last few days. I tracked it down to the fact that nfs_reclaim() is setting vp->v_data to NULL _before_ calling vnode_destroy_object(). After silence from the mailing list I checked further and discovered that ufs_reclaim() is unique among FreeBSD filesystems for calling vnode_destroy_object() early, long before tossing v_data or much of anything else, for that matter. The rest, including NFS, appear to be identical, as if they were just clones of one original routine. The enclosed patch fixes all file systems in essentially the same way, by moving the call to vnode_destroy_object() to early in the routine (before the call to vfs_hash_remove(), if any). I have only tested NFS, but I've now run for over eighteen hours with the patch where I wouldn't get past four or five without it. Submitted by: Frank Mayhar Requested by: Mohan Srinivasan MFC After: 1 week
* In nfs_dolock(), GC now under-used ioflg, rendered obsolete when we movedrwatson2006-01-131-4/+1
| | | | | | | from using a fifo to talk to rpc.lockd to using a special device node. Noticed by: Coverity Prevent analysis tool MFC after: 3 days
* Add marker vnodes to ensure that all vnodes associated with the mount point aretegge2006-01-091-2/+3
| | | | | | iterated over when using MNT_VNODE_FOREACH. Reviewed by: truckman
* Correct a typodelphij2005-12-281-1/+1
|
* Improve upon rev 1.133 where NFS/TCP would not reconnect.ps2005-12-121-13/+2
| | | | Submitted by: Mohan Srinivasan
* Unexpand LLADDR().ru2005-11-291-2/+2
|
* Fix for a bug where NFS/TCP would not reconnect (in the case whereps2005-11-211-1/+12
| | | | | | | the server FIN'ed). Seen with Solaris NFS servers. Reported by: TOMITA Yoshinori <yoshint@flab.fujitsu.co.jp> Submitted by: Mohan Strinivasan
* - Always return success from NFS strategy. nfs_doio(), in theps2005-11-212-5/+4
| | | | | | | | | | | | 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
* fix a problem with XID re-use when a server returns NFSERR_JUKEBOX.rees2005-11-213-7/+13
| | | | | | | Submitted by: cel@citi.umich.edu Fixed by: rick@snowhite.cis.uoguelph.ca Approved by: alfred MFC after: 3 weeks
* fix a crash when an nfsv2 mount failsjon2005-11-101-2/+4
| | | | MFC after: 1 week
* Fix for a crash (from nfs_lookup() in an error case).ps2005-11-031-1/+1
| | | | Submitted by: Mohan Srinivasan
* In nfs_flush(), clear the NMODIFIED bit only if there are no dirtyps2005-11-031-1/+2
| | | | | | | | | | | buffers *and* there are no buffers queued up for writing. The bug was that NMODIFIED was being cleared even while there were buffers scheduled to be written out, which leads to all sorts of interesting bugs - one where the file could shrink (because of a post-op getattr load, say) causing data in buffer(s) queued for write to be tossed, resulting in data corruption. Submitted by: Mohan Srinivasan
* Fix for a race between the thread transmitting the request and theps2005-11-031-1/+5
| | | | | | thread processing the reply. Submitted by: Mohan Srinivasan
* Normalize a significant number of kernel malloc type names:rwatson2005-10-313-8/+8
| | | | | | | | | | | | | | | | | | | - Prefer '_' to ' ', as it results in more easily parsed results in memory monitoring tools such as vmstat. - Remove punctuation that is incompatible with using memory type names as file names, such as '/' characters. - Disambiguate some collisions by adding subsystem prefixes to some memory types. - Generally prefer lower case to upper case. - If the same type is defined in multiple architecture directories, attempt to use the same name in additional cases. Not all instances were caught in this change, so more work is required to finish this conversion. Similar changes are required for UMA zone names.
* - Fix leak of struct nlminfo on process exit.glebius2005-10-262-3/+15
| | | | | | | - Fix malloc type collision, that made the above problem difficult to understand. Reported by: Vladimir Sharun <sharun ukr.net>
* - Use strsep() instead of strtok().pjd2005-10-061-7/+6
| | | | | | | - strdup() uses M_WAITOK, so we don't need to check it's return value against NULL. MFC after: 2 weeks
* Add boot.nfsroot.options loader tunable.pjd2005-10-061-0/+30
| | | | | | | | | | | | | | | | | 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" MFC after: 2 weeks
* Add GIANT_REQUIRED and WITNESS sleep warnings to uprintf() and tprintf(),rwatson2005-09-191-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | as they both interact with the tty code (!MPSAFE) and may sleep if the tty buffer is full (per comment). Modify all consumers of uprintf() and tprintf() to hold Giant around calls into these functions. In most cases, this means adding an acquisition of Giant immediately around the function. In some cases (nfs_timer()), it means acquiring Giant higher up in the callout. With these changes, UFS no longer panics on SMP when either blocks are exhausted or inodes are exhausted under load due to races in the tty code when running without Giant. NB: Some reduction in calls to uprintf() in the svr4 code is probably desirable. NB: In the case of nfs_timer(), calling uprintf() while holding a mutex, or even in a callout at all, is a bad idea, and will generate warnings and potential upset. This needs to be fixed, but was a problem before this change. NB: uprintf()/tprintf() sleeping is generally a bad ideas, as is having non-MPSAFE tty code. MFC after: 1 week
* FIx for a bug in the change that made nfs_timer() MPSAFE. We need tops2005-07-271-0/+2
| | | | | | | grab Giant before calling pru_send() (if running with mpsafenet = 0). Found by: Jeremie Le Hen. Fixed by: Maxime Henrion
* In nfs_nget() if two threads race on the same filehandle, the loser shouldps2005-07-271-1/+2
| | | | | | | | cause the nfsnode to get freed. This fixes a potential vnode (and nfsnode) leak in that path. Submitted by: Mohan Srinivasan Reviewed by: phk
* Remove the NFS client rslock. The rslock was used to serializeps2005-07-213-114/+2
| | | | | | | | | | | writers that want to extend the file. It was also used to serialize readers that might want to read the last block of the file (with a writer extending the file). Now that we support vnode locking for NFS, the rslock is unnecessary. Writers grab the exclusive vnode lock before writing and readers grab the shared (or in some cases the exclusive) lock. Submitted by: Mohan Srinivasan
* Make nfs_timer() MPSAFE. With this change, the bottom half of the NFSps2005-07-193-12/+23
| | | | | | | client (the interface with the protocol stack and callouts) is Giant-free. Submitted by: Mohan Srinivasan.
* Fix for a NFS soft mounts bug where if the number of retries exceedsps2005-07-181-1/+2
| | | | | | | | the max rexmits, the request was not being bounced back with a ETIMEDOUT error. Reported by: Oliver Lehmann Submitted by: Mohan Srinivasan
* Fixes for NFS crashes on architectures that require strict alignment.ps2005-07-141-1/+2
| | | | | | | | | | - 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
* Ifdef out the incomplete non-blocking IO implementation for NFSgreen2005-06-161-0/+2
| | | | | | | | pending discussion of how implementation would proceed. Applications like -lc_r expect select(3) to match the EAGAIN-status of IO functions. Approved by: re
* Fix a serious deadlock with the NFS client. Given a large enoughgreen2005-06-104-2/+77
| | | | | | | | | | | | | | | | | | | | | | | | atomic write request, it can fill the buffer cache with the entirety of that write in order to handle retries. However, it never drops the vnode lock, or else it wouldn't be atomic, so it ends up waiting indefinitely for more buf memory that cannot be gotten as it has it all, and it waits in an uncancellable state. To fix this, hibufspace is exported and scaled to a reasonable fraction. This is used as the limit of how much of an atomic write request by the NFS client will be handled asynchronously. If the request is larger than this, it will be turned into a synchronous request which won't deadlock the system. It's possible this value is far off from what is required by some, so it shall be tunable as soon as mount_nfs(8) learns of the new field. The slowdown between an asynchronous and a synchronous write on NFS appears to be on the order of 2x-4x. General nod by: gad MFC after: 2 weeks More testing: wes PR: kern/79208
* Ugh. Previous commit got the logic exactly backward.des2005-05-171-2/+2
| | | | | Submitted by: bland Pointy hat to: des
* Revision 1.173 broke updating a mount from ro to rw. Fix that by clearingdes2005-05-171-1/+11
| | | | | | the MNT_RDONLY flag if MNT_UPDATE is set and "ro" was not specified. Suggested by: cognet
* set R_MUSTRESEND flag in mark_for_reconnect so re-connected requests getrees2005-05-101-12/+6
| | | | | | | | | | | re-sent instead of timing out. don't log an error message on reconnection, which is not an error. remove unused nfs_mrep_before_tsleep. Reviewed by: Mohan Srinivasan Approved by: alfred
* Fix a bug in NFS/TCP where retransmissions would not reliably happenps2005-05-041-3/+11
| | | | | | | if the server rebooted or tore down the connection for any reason. Found by: Jonathan Noack. Submitted by: Mohan Srinivasan.
* Don't copy the NFSMNT_* flags into struct statfs's f_flags field,iedowse2005-05-021-1/+0
| | | | | | | | | | | as they have no connection with the expected MNT_* flags. This bug was exposed 18 months ago when the assignments to f_flags in vfs_syscalls.c were moved to before the VFS_STATFS() call. It was fixed in the CSRG source 10 years ago, but we never picked up that change. PR: kern/80390 MFC after: 1 week
* When NFS was converted to the new mount syscall, code was written that setsdes2005-04-271-3/+1
| | | | | | | | | | | the MNT_RDONLY flag if the "ro" option was passed in from userland, and clears it otherwise. In the diskless case, the MNT_RDONLY flag is already set when this code is reached, but there are no mount options, so it was incorrectly cleared. Change the logic so the MNT_RDONLY flag is set if the "ro" option was specified, and left alone otherwise. Note that the NFS code will still happily let you mount a filesystem RW even if the server exports it RO. I'm not sure how to fix that.
* While I'm here, list the new kenv (boot.netif.name) along with the others.des2005-04-261-0/+1
|
* When netbooting, as soon as we've figured out which interface we booteddes2005-04-262-0/+3
| | | | from, store its name in a kenv variable.
* TCP reconnect is not an error.rees2005-04-181-3/+3
| | | | | | Change the message from LOG_ERR to LOG_INFO. Approved by: alfred
* - cache_lookup() relocks the parent in the DOTDOT case for us.jeff2005-04-141-2/+0
| | | | | Spotted by: phk Sponsored by: Isilon Systems, Inc.
* - Change all filesystems and vfs_cache to relock the dvp once the child isjeff2005-04-131-3/+2
| | | | | | locked in the ISDOTDOT case. Se vfs_lookup.c r1.79 for details. Sponsored by: Isilon Systems, Inc.
* - LK_NOPAUSE is a nop now.jeff2005-03-311-1/+1
| | | | Sponsored by: Isilon Systems, Inc.
OpenPOWER on IntegriCloud