linux/fs/nfs
Chuck Lever 28c494c5c8 NFS: Prevent nfs_getattr() hang during heavy write workloads
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>
2008-01-30 02:05:45 -05:00
..
callback_proc.c [PATCH] fs/nfs/callback* passes error values big-endian 2006-10-20 10:26:40 -07:00
callback_xdr.c NFSv4: debug print ntohl(status) in nfs client callback xdr code 2007-07-19 15:21:40 -04:00
callback.c Freezer: make kernel threads nonfreezable by default 2007-07-17 10:23:02 -07:00
callback.h NFS: Fix more sparse warnings 2007-05-14 19:33:46 -04:00
client.c NFS: Stop sillyname renames and unmounts from racing 2008-01-30 02:05:24 -05:00
delegation.c NFSv4: Fix an rpc_cred reference leakage in fs/nfs/delegation.c 2007-10-19 17:19:30 -04:00
delegation.h NFSv4: Use RCU to protect delegations 2007-07-10 23:40:41 -04:00
dir.c NFS: Ensure that we eject stale inodes as soon as possible 2008-01-30 02:05:22 -05:00
direct.c NFS/SUNRPC: Convert users of rpc_init_task+rpc_execute to rpc_run_task() 2008-01-30 02:05:39 -05:00
file.c NFS: Optimise nfs_vm_page_mkwrite() 2008-01-30 02:05:23 -05:00
getroot.c NFS: Fix an Oops in NFS unmount 2007-12-12 11:12:15 -05:00
idmap.c NFS: use __set_current_state() 2007-05-09 17:58:01 -04:00
inode.c NFS: Prevent nfs_getattr() hang during heavy write workloads 2008-01-30 02:05:45 -05:00
internal.h NFS: Stop sillyname renames and unmounts from racing 2008-01-30 02:05:24 -05:00
iostat.h NFSv4: Fix an oops in nfs4_fill_super 2006-03-20 13:44:48 -05:00
Makefile [NFS] [PATCH] nfs: tiny makefile cleanup 2007-10-09 17:15:36 -04:00
mount_clnt.c NFS: Improve debugging output in NFS in-kernel mount client 2007-07-10 23:40:47 -04:00
namespace.c NFS: Fix use of cancel_delayed_work_sync in nfs_release_automount_timer 2007-09-01 10:14:36 -04:00
nfs2xdr.c NFS: Use unsigned intermediates for manipulating header lengths (NFSv2 XDR) 2008-01-30 02:05:44 -05:00
nfs3acl.c NFS: Remove nfs_begin_data_update/nfs_end_data_update 2007-10-09 17:19:53 -04:00
nfs3proc.c NFS: Clean up the (commit|read|write)_setup() callback routines 2008-01-30 02:05:32 -05:00
nfs3xdr.c NFS: Use unsigned intermediates for manipulating header lengths (NFSv3 XDR) 2008-01-30 02:05:44 -05:00
nfs4_fs.h NFSv4: Give the lock stateid its own sequence queue 2008-01-10 13:35:32 -08:00
nfs4namespace.c NFSv4: /proc/mounts displays the wrong server name for referrals 2007-02-03 15:35:10 -08:00
nfs4proc.c NFS/SUNRPC: Convert all users of rpc_call_setup() 2008-01-30 02:05:32 -05:00
nfs4renewd.c NFSv4: Fix circular locking dependency in nfs4_kill_renewd 2008-01-03 09:37:16 -05:00
nfs4state.c NFSv4: Clean up the OPEN/CLOSE serialisation code 2008-01-30 02:05:24 -05:00
nfs4xdr.c NFS: Change sign of some loop indices in nfs4xdr.c 2008-01-30 02:05:44 -05:00
nfsroot.c Convert files to UTF-8 and some cleanups 2007-10-19 23:21:04 +02:00
pagelist.c NFS: Clean up the write request locking. 2008-01-30 02:05:24 -05:00
proc.c NFS: Clean up the (commit|read|write)_setup() callback routines 2008-01-30 02:05:32 -05:00
read.c NFS/SUNRPC: Convert users of rpc_init_task+rpc_execute to rpc_run_task() 2008-01-30 02:05:39 -05:00
super.c NFS: Stop sillyname renames and unmounts from racing 2008-01-30 02:05:24 -05:00
symlink.c header cleaning: don't include smp_lock.h when not used 2007-05-08 11:15:07 -07:00
sysctl.c [PATCH] nfs: fix congestion control 2007-03-16 19:25:05 -07:00
unlink.c NFS/SUNRPC: Convert all users of rpc_call_setup() 2008-01-30 02:05:32 -05:00
write.c NFS/SUNRPC: Convert users of rpc_init_task+rpc_execute to rpc_run_task() 2008-01-30 02:05:39 -05:00