All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] NFS - Fix for Infinite loop during syncing
@ 2004-12-13 20:23 Steve Dickson
  2004-12-13 20:45 ` Trond Myklebust
  2005-01-31 17:44 ` Steve Dickson
  0 siblings, 2 replies; 5+ messages in thread
From: Steve Dickson @ 2004-12-13 20:23 UTC (permalink / raw)
  To: nfs

[-- Attachment #1: Type: text/plain, Size: 752 bytes --]


It was brought to my attention that following series of events
would cause an infinite loop in the 2.4 nfs kernels.

1) Mount the fileystem with acregmin=1,acregmax=1 from two clients.
2) On client 1, create a process that continuously writes to a file.
3) On client 2, remove that file that is being written
4) On client 1, interrupted out of the writing process (which is failing
     with ESTALEs) and type sync

The sync process loops in wait_on_locked(), when called from
sync_inodes_sb(), since the "broken" inode can not be cleared
from the locked inode list.

This patch sets the NFS_INO_STALE bit in write path (via
nfs_writeback_done) which breaks the inode is early enough to
stop it from being added to the that list.

Comments?

steved.


[-- Attachment #2: linux-2.4.28-nfs-syncloop.patch --]
[-- Type: text/plain, Size: 472 bytes --]

--- linux-2.4.28/fs/nfs/write.c.orig	2004-04-14 09:05:40.000000000 -0400
+++ linux-2.4.28/fs/nfs/write.c	2004-12-13 14:23:55.000000000 -0500
@@ -1073,6 +1073,9 @@ nfs_writeback_done(struct rpc_task *task
 			SetPageError(page);
 			if (req->wb_file)
 				req->wb_file->f_error = task->tk_status;
+			if (task->tk_status == -ESTALE)
+				NFS_FLAGS(inode) |= NFS_INO_STALE;
+
 			nfs_inode_remove_request(req);
 			dprintk(", error = %d\n", task->tk_status);
 			goto next;

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-01-31 17:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-12-13 20:23 [PATCH] NFS - Fix for Infinite loop during syncing Steve Dickson
2004-12-13 20:45 ` Trond Myklebust
2004-12-13 21:20   ` Steve Dickson
2004-12-14  0:14     ` Steve Dickson
2005-01-31 17:44 ` Steve Dickson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.