summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* NFS: Prevent nfs_getattr() hang during heavy write workloadsChuck Lever2008-01-301-2/+11
| | | | | | | | | | | | | | | | | | | POSIX requires that ctime and mtime, as reported by the stat(2) call, reflect the activity of the most recent write(2). To that end, nfs_getattr() flushes pending dirty writes to a file before doing a GETATTR to allow the NFS server to set the file's size, ctime, and mtime properly. However, nfs_getattr() can be starved when a constant stream of application writes to a file prevents nfs_wb_nocommit() from completing. This usually results in hangs of programs doing a stat against an NFS file that is being written. "ls -l" is a common victim of this behavior. To prevent starvation, hold the file's i_mutex in nfs_getattr() to freeze applications writes temporarily so the client can more quickly obtain clean values for a file's size, mtime, and ctime. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Change sign of some loop indices in nfs4xdr.cChuck Lever2008-01-301-8/+8
| | | | | | | Nit: Eliminate some mixed sign comparisons in loop indices. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Use unsigned intermediates for manipulating header lengths (NFSv4 XDR)Chuck Lever2008-01-301-5/+9
| | | | | | | | Clean up: prevent length underflow and mixed sign comparison when unmarshalling NFS version 4 getacl, readdir, and readlink replies. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Use unsigned intermediates for manipulating header lengths (NFSv3 XDR)Chuck Lever2008-01-301-12/+15
| | | | | | | | Clean up: prevent length underflow and mixed sign comparisons when unmarshalling NFS version 3 read, readdir, and readlink replies. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Use unsigned intermediates for manipulating header lengths (NFSv2 XDR)Chuck Lever2008-01-301-10/+14
| | | | | | | | Clean up: prevent length underflow and mixed sign comparisons when unmarshalling NFS version 2 read, readdir, and readlink replies. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Ensure nfs_wcc_update_inode always converts file size to loff_tChuck Lever2008-01-301-2/+3
| | | | | | | | | | | | | | The nfs_wcc_update_inode() function omits logic to convert the type of the NFS on-the-wire value of a file's size (__u64) to the type of file size value stored in struct inode (loff_t, which is signed). Everywhere else in the NFS client I checked already correctly converts the file size type. This effects only very large files. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* SUNRPC: Remove an unneeded implicit type cast when calling rpc_depopulate()Chuck Lever2008-01-301-2/+2
| | | | | | | | The two arguments of rpc_depopulate() that pass in inode numbers should use the same type as inode->i_ino: unsigned long. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* SUNRPC: temp var should match return type of xdr_skb_read_actorChuck Lever2008-01-301-1/+1
| | | | | | | | The return type of xdr_skb_read_actor functions is size_t. This fixes a nit I unwittingly overlooked in commit dd456471. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* SUNRPC: Check a return resultChuck Lever2008-01-301-3/+5
| | | | | | | | Minor: Replace an empty if statement with a debugging dprintk. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Cc: Thomas Talpey <Thomas.Talpey@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* SUNRPC: Fix an unnecessary implicit type cast in rpcrdma_count_chunks()Chuck Lever2008-01-301-1/+1
| | | | | | | | | | Nit: rl_nchunks is an unsigned integer, so pass it into rpcrdma_count_chunks() via an unsigned integer argument. This eliminates a harmless mixed sign comparison in rpcrdma_count_chunks() Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Cc: Thomas Talpey <Thomas.Talpey@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* SUNRPC: Prevent mixed sign comparisons in rpcrdma_convert_iovs()Chuck Lever2008-01-301-3/+3
| | | | | | | | | | Keep the type of the buffer position the same during iovec conversion to reduce the likelihood of unexpected results from comparisons and length computations. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Cc: Thomas Talpey <Thomas.Talpey@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* SUNRPC: Remove the obsolete RPC_WAITQ macroTrond Myklebust2008-01-301-23/+0
| | | | | | Now that we've killed off all the users. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* SUNRPC: Cleanup to remove the last users of the RPC_WAITQ declarationTrond Myklebust2008-01-301-1/+6
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* SUNRPC: Unexport rpc_init_task() and rpc_execute()Trond Myklebust2008-01-302-4/+1
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS/SUNRPC: Convert users of rpc_init_task+rpc_execute to rpc_run_task()Trond Myklebust2008-01-303-34/+35
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* SUNRPC: allow the caller of rpc_run_task to preallocate the struct rpc_taskTrond Myklebust2008-01-302-6/+11
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* SUNRPC: Remove the now unused function rpc_call_setup()Trond Myklebust2008-01-302-19/+0
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS/SUNRPC: Convert all users of rpc_call_setup()Trond Myklebust2008-01-303-107/+79
| | | | | | | Replace use of rpc_call_setup() with rpc_init_task(), and in cases where we need to initialise task->tk_action, with rpc_call_start(). Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Clean up the (commit|read|write)_setup() callback routinesTrond Myklebust2008-01-307-143/+113
| | | | | | | Move the common code for setting up the nfs_write_data and nfs_read_data structures into fs/nfs/read.c, fs/nfs/write.c and fs/nfs/direct.c. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* SUNRPC: Allow rpc_init_task() to initialise the rpc_task->tk_msgTrond Myklebust2008-01-302-7/+15
| | | | | | In preparation for the removal of rpc_call_setup(). Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* SUNRPC: Add a helper rpc_call_start() that initialises task->tk_actionTrond Myklebust2008-01-302-1/+8
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* SUNRPC: Mask signals across the call to rpc_call_setup() in rpc_run_taskTrond Myklebust2008-01-302-6/+10
| | | | | | To ensure that the RPCSEC_GSS upcall is performed with the correct sigmask. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* SUNRPC: Clean up the initialisation of priority queue scheduling info.Trond Myklebust2008-01-305-42/+29
| | | | | | | | | | We want the default scheduling priority (priority == 0) to remain RPC_PRIORITY_NORMAL. Also ensure that the priority wait queue scheduling is per process id instead of sometimes being per thread, and sometimes being per inode. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* SUNRPC: Clean up rpc_run_taskTrond Myklebust2008-01-305-38/+67
| | | | | | | Make it use the new task initialiser structure instead of acting as a wrapper. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* SUNRPC: Cleanup of rpc_task initialisationTrond Myklebust2008-01-307-58/+117
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* SUNRPC: Restrict sunrpc client exportsTrond Myklebust2008-01-306-44/+44
| | | | | | | | The sunrpc client exports are not meant to be part of any official kernel API: they can change at the drop of a hat. Mark them as internal functions using EXPORT_SYMBOL_GPL. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* SUNRPC: Move exported declarations to the function declarationsTrond Myklebust2008-01-309-67/+55
| | | | | | Do this for all RPC client related functions and XDR functions. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* sunrpc: document the rpc_pipefs kernel apiJ. Bruce Fields2008-01-301-1/+51
| | | | | | | Add kerneldoc comments for the rpc_pipefs.c functions that are exported. Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* SUNRPC: Reconnect immediately whenever the server isn't refusing it.Trond Myklebust2008-01-301-1/+9
| | | | | | | If we've disconnected from the server, rather than the other way round, then it makes little sense to wait 3 seconds before reconnecting. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* SUNRPC: Rename xprt_disconnect()Trond Myklebust2008-01-304-8/+8
| | | | | | | | xprt_disconnect() should really only be called when the transport shutdown is completed, and it is time to wake up any pending tasks. Rename it to xprt_disconnect_done() in order to reflect the semantical change. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* SUNRPC: Make call_status()/call_decode() call xprt_force_disconnect()Trond Myklebust2008-01-302-3/+3
| | | | | | | | | Move the calls to xprt_disconnect() over to xprt_force_disconnect() in order to enable the transport layer to manage the state of the XPRT_CONNECTED flag. Ditto in xs_tcp_read_fraghdr(). Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* SUNRPC: xprt_autoclose() should not call xprt_disconnect()Trond Myklebust2008-01-302-3/+1
| | | | | | | | | | | The transport layer should do that itself whenever appropriate. Note that the RDMA transport already assumes that it needs to call xprt_disconnect in xprt_rdma_close(). For TCP sockets, we want to call xprt_disconnect() only after the connection has been closed by both ends. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* SUNRPC: Use shutdown() instead of close() when disconnecting a TCP socketTrond Myklebust2008-01-301-7/+34
| | | | | | | | | | By using shutdown() rather than close() we allow the RPC client to wait for the TCP close handshake to complete before we start trying to reconnect using the same port. We use shutdown(SHUT_WR) only instead of shutting down both directions, however we wait until the server has closed the connection on its side. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* SUNRPC: TCP clear XPRT_CLOSE_WAIT when the socket is closed for writesTrond Myklebust2008-01-301-0/+2
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* SUNRPC: Allow the client to detect if the TCP connection is closedTrond Myklebust2008-01-302-3/+22
| | | | | | | | Add an xprt->state bit to enable the TCP ->state_change() method to signal whether or not the TCP connection is in the process of closing down. This will to be used by the reconnection logic in a separate patch. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* SUNRPC: Fix TCP rebinding logicTrond Myklebust2008-01-301-21/+38
| | | | | | | | | | | | | | | Currently the TCP rebinding logic assumes that if we're not using a reserved port, then we don't need to reconnect on the same port if a disconnection event occurs. This breaks most RPC duplicate reply cache implementations. Also take into account the fact that xprt_min_resvport and xprt_max_resvport may change while we're reconnecting, since the user may change them at any time via the sysctls. Ensure that we check the port boundaries every time we loop in xs_bind4/xs_bind6. Also ensure that if the boundaries change, we only scan the ports a maximum of 2 times. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* SUNRPC: Fix a race in xs_tcp_state_change()Trond Myklebust2008-01-303-4/+22
| | | | | | | When scheduling the autoclose RPC call, we want to ensure that we don't race against the test_bit() call in xprt_clear_locked(). Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Stop sillyname renames and unmounts from racingSteve Dickson2008-01-305-0/+39
| | | | | | | | | Added an active/deactive mechanism to the nfs_server structure allowing async operations to hold off umount until the operations are done. Signed-off-by: Steve Dickson <steved@redhat.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv4: Clean up the OPEN/CLOSE serialisation codeTrond Myklebust2008-01-302-35/+27
| | | | | | | | Reduce the time spent locking the rpc_sequence structure by queuing the nfs_seqid only when we are ready to take the lock (when calling nfs_wait_on_sequence). Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Clean up the write request locking.Trond Myklebust2008-01-303-26/+16
| | | | | | Ensure that we set/clear NFS_PAGE_TAG_LOCKED when the nfs_page is hashed. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Optimise nfs_vm_page_mkwrite()Trond Myklebust2008-01-301-22/+14
| | | | | | | The current model locks the page twice for no good reason. Optimise by inlining the parts of nfs_write_begin()/nfs_write_end() that we care about. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Ensure that we eject stale inodes as soon as possibleTrond Myklebust2008-01-301-0/+4
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Handle -ENOENT errors in unlink()/rmdir()/rename()Trond Myklebust2008-01-301-2/+13
| | | | | | | If the server returns an ENOENT error, we still need to do a d_delete() in order to ensure that the dentry is deleted. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Sillyrename: in the case of a race, check aliases are really positiveTrond Myklebust2008-01-301-1/+3
| | | | | | | | | In nfs_do_call_unlink() we check that we haven't raced, and that lookup() hasn't created an aliased dentry to our sillydeleted dentry. If somebody has deleted the file on the server and the lookup() resulted in a negative dentry, then ignore... Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Fix a sillyrename race...Trond Myklebust2008-01-302-7/+6
| | | | | | | | | | | Ensure that readdir revalidates its data cache after blocking on sillyrename. Also fix a typo in nfs_do_call_unlink(): swap the ^= for an |=. The result is the same, since we've already checked that the flag is unset, but it makes the code more readable. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* Mostly revert "e1000/e1000e: Move PCI-Express device IDs over to e1000e"Linus Torvalds2008-01-302-1/+28
| | | | | | | | | | | | | | The new e1000e driver is apparently not yet suitable for general use, so mark it experimental, and re-instate all the PCI-Express device IDs in the old and stable e1000 driver so that people (namely me) can continue to use a driver that actually works. Auke & co have been appraised of the situation. Cc: Auke Kok <auke-jan.h.kok@intel.com> Cc: Jeff Garzik <jeff@garzik.org> Cc: David Miller <davem@davemloft.net> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* splice: fix problem with atime not being updatedJens Axboe2008-01-291-8/+7
| | | | | | | | | A bug report on nfsd that states that since it was switched to use splice instead of sendfile, the atime was no longer being updated on the input file. do_generic_mapping_read() does this when accessing the file, make splice do it for the direct splice handler. Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
* block: constify function pointer tablesJan Engelhardt2008-01-291-2/+2
| | | | | Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
* cciss: fix bug in overriding ->data_len before completionJens Axboe2008-01-291-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For BLOCK_PC requests, we need that length for completing the request. Andrew Vasquez <andrew.vasquez@qlogic.com> reported the following oops Hitting a consistent BUG() with recent Linus' linux-2.6.git: [ 12.941428] ------------[ cut here ]------------ [ 12.944874] kernel BUG at drivers/block/cciss.c:1260! [ 12.944874] invalid opcode: 0000 [1] SMP [ 12.944874] CPU 0 [ 12.944874] Modules linked in: [ 12.944874] Pid: 0, comm: swapper Not tainted 2.6.24 #43 [ 12.944874] RIP: 0010:[<ffffffff8039e43d>] [<ffffffff8039e43d>] cciss_softirq_done+0xbc/0x1bf [ 12.944874] RSP: 0018:ffffffff8063aed0 EFLAGS: 00010202 [ 12.944874] RAX: 0000000000000001 RBX: ffff8100cf800010 RCX: ffff81042f1253b0 [ 12.944874] RDX: ffff81042de398f0 RSI: ffff81042de398f0 RDI: 0000000000000001 [ 12.944874] RBP: ffff81042daa0000 R08: ffff81042f1253b0 R09: 0000000000000001 [ 12.944874] R10: 00000000000000fe R11: 0000000000000000 R12: 0000000000000002 [ 12.944874] R13: 0000000000000001 R14: ffff8100cf800000 R15: ffff81042de398f0 [ 12.944874] FS: 0000000000000000(0000) GS:ffffffff805bb000(0000) knlGS:0000000000000000 [ 12.944874] CS: 0010 DS: 0018 ES: 0018 CR0: 000000008005003b [ 12.944874] CR2: 00002afed7eea340 CR3: 000000042dbba000 CR4: 00000000000006e0 [ 12.944874] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 12.944874] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400 [ 12.944874] Process swapper (pid: 0, threadinfo ffffffff805f4000, task ffffffff805624a0) [ 12.944874] Stack: 0000000000000000 ffffffff8063af10 0000000000000001 ffffffff80632d60 [ 12.944874] 0000000000000000 000000000000000a ffffffff805bb900 ffffffff8032038f [ 12.944874] ffffffff8063af10 ffffffff8063af10 ffffffff805bb940 ffffffff802346b4 [ 12.944874] Call Trace: [ 12.944874] <IRQ> [<ffffffff8032038f>] blk_done_softirq+0x69/0x78 [ 12.944874] [<ffffffff802346b4>] __do_softirq+0x6f/0xd8 [ 12.944874] [<ffffffff8020c45c>] call_softirq+0x1c/0x30 [ 12.944874] [<ffffffff8020e347>] do_softirq+0x30/0x80 [ 12.944874] [<ffffffff8020e409>] do_IRQ+0x72/0xd9 [ 12.944874] [<ffffffff8020a50a>] mwait_idle+0x0/0x46 [ 12.944874] [<ffffffff8020a3da>] default_idle+0x0/0x3d [ 12.944874] [<ffffffff8020b7e1>] ret_from_intr+0x0/0xa [ 12.944874] <EOI> [<ffffffff8020a54c>] mwait_idle+0x42/0x46 [ 12.944874] [<ffffffff8020a481>] cpu_idle+0x6a/0xae [ 12.944874] [ 12.944874] [ 12.944874] Code: 0f 0b eb fe 48 8d 85 d8 c0 00 00 48 89 04 24 48 89 c7 e8 e5 [ 12.944874] RIP [<ffffffff8039e43d>] cciss_softirq_done+0xbc/0x1bf [ 12.944874] RSP <ffffffff8063aed0> [ 12.944903] ---[ end trace e9c631603f90d22f ]--- which is caused by blk_end_request() returning 'not done' for a request, since it gets asked to complete zero bytes. Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
* Expose hardware sector sizeMartin K. Petersen2008-01-291-0/+11
| | | | | | | Expose hardware sector size in sysfs queue directory. Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
OpenPOWER on IntegriCloud