linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] nfs: fix inifinite loop at nfs4_layoutcommit_release
@ 2011-08-28  6:22 Vitaliy Gusev
  2011-09-06 19:29 ` Trond Myklebust
  0 siblings, 1 reply; 29+ messages in thread
From: Vitaliy Gusev @ 2011-08-28  6:22 UTC (permalink / raw)
  To: Trond.Myklebust; +Cc: peng_tao, linux-nfs, Vitaliy Gusev

pnfs_layout_segment can be already under handling LAYOUTCOMMIT,
so adding list twice causes hang:

   BUG: soft lockup - CPU#0 stuck for 22s! [kworker/0:0:4]
   Call Trace:

     nfs4_layoutcommit_release+0x5a/0x9c [nfs]
     rpc_release_calldata+0x17/0x19 [sunrpc]
     rpc_free_task+0x5e/0x66 [sunrpc]
     __rpc_execute+0x29e/0x2ad [sunrpc]
     rpc_async_schedule+0x15/0x17 [sunrpc]
     process_one_work+0x213/0x3ba
     process_one_work+0x142/0x3ba
     __rpc_execute+0x2ad/0x2ad [sunrpc]
     worker_thread+0xfd/0x181

Signed-off-by: Vitaliy Gusev <gusev.vitaliy@nexenta.com>
---
 fs/nfs/pnfs.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index e550e88..1465f44 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -1376,7 +1376,8 @@ static void pnfs_list_write_lseg(struct inode *inode, struct list_head *listp)
 
 	list_for_each_entry(lseg, &NFS_I(inode)->layout->plh_segs, pls_list) {
 		if (lseg->pls_range.iomode == IOMODE_RW &&
-		    test_bit(NFS_LSEG_LAYOUTCOMMIT, &lseg->pls_flags))
+		    test_bit(NFS_LSEG_LAYOUTCOMMIT, &lseg->pls_flags) &&
+		    list_empty(&lseg->pls_lc_list))
 			list_add(&lseg->pls_lc_list, listp);
 	}
 }
-- 
1.7.4.1


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

end of thread, other threads:[~2011-09-14 13:20 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-28  6:22 [PATCH] nfs: fix inifinite loop at nfs4_layoutcommit_release Vitaliy Gusev
2011-09-06 19:29 ` Trond Myklebust
2011-09-06 22:13   ` Vitaliy Gusev
2011-09-06 22:32     ` Trond Myklebust
2011-09-08 10:21       ` tao.peng
2011-09-08 12:01         ` Myklebust, Trond
2011-09-08 15:00           ` Peng Tao
2011-09-08 17:05             ` Myklebust, Trond
2011-09-09  3:11               ` tao.peng
2011-09-09 18:20                 ` Trond Myklebust
2011-09-10  7:14                   ` Benny Halevy
2011-09-12 14:56                     ` Peng Tao
2011-09-12 20:31                       ` Benny Halevy
2011-09-12 21:10                         ` Trond Myklebust
2011-09-13  7:50                           ` Benny Halevy
2011-09-13  8:32                             ` tao.peng
2011-09-14  6:43                               ` Benny Halevy
2011-09-14  7:53                                 ` tao.peng
     [not found]                                   ` <F19688880B763E40B28B2B462677FBF805C3F7A911-AYrsSIZi/B2B3McK65YKY9BPR1lH4CV8@public.gmane.org>
2011-09-14 13:20                                     ` Benny Halevy
2011-09-13  8:09                           ` tao.peng
2011-09-14  6:46                             ` Benny Halevy
2011-09-13  7:02                         ` tao.peng
2011-09-13  7:54                           ` Benny Halevy
2011-09-12 14:48                   ` Peng Tao
2011-09-08 10:00     ` tao.peng
2011-09-08 13:02       ` Vitaliy Gusev
2011-09-08 15:09         ` Peng Tao
2011-09-09 17:46           ` Vitaliy Gusev
2011-09-12 14:42             ` Peng Tao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).