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
..
2007-10-17 08:42:47 -07:00
2008-01-28 23:58:27 -05:00
2007-10-19 11:53:37 -07:00
2007-12-05 09:25:20 -08:00
2008-01-25 10:12:41 +00:00
2007-10-22 08:13:21 -07:00
2008-01-17 15:38:58 -08:00
2007-10-16 09:43:07 -07:00
2008-01-24 16:13:21 -06:00
2007-10-18 14:37:31 -07:00
2007-11-03 12:27:21 -07:00
2008-01-28 15:01:36 -08:00
2008-01-28 23:14:37 +01:00
2007-12-05 09:21:18 -08:00
2008-01-11 18:05:04 +11:00
2008-01-07 14:55:37 -08:00
2007-10-17 08:42:54 -07:00
2008-01-28 23:21:18 +01:00
2007-07-29 17:09:29 -07:00
2007-10-16 09:42:53 -07:00
2007-11-28 10:58:01 -08:00
2007-07-16 09:05:48 -07:00
2008-01-28 23:58:27 -05:00
2007-10-22 08:13:19 -07:00
2007-10-16 09:42:54 -07:00
2007-07-19 10:04:45 -07:00
2007-11-14 18:45:42 -08:00
2007-10-15 17:00:19 +02:00
2007-07-27 15:40:13 -07:00
2007-10-19 11:53:41 -07:00
2007-10-17 08:43:01 -07:00
2007-10-17 08:42:52 -07:00