mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Trond Myklebust <Trond.Myklebust@netapp.com>
To: Florin Iucha <florin@iucha.net>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Adrian Bunk <bunk@stusta.de>,
	OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 0/4] 2.6.21-rc7 NFS writes: fix a series of issues
Date: Wed, 18 Apr 2007 07:38:07 -0400	[thread overview]
Message-ID: <1176896287.6796.47.camel@heimdal.trondhjem.org> (raw)
In-Reply-To: <20070418040730.GC24044@iucha.net>

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

On Tue, 2007-04-17 at 23:07 -0500, Florin Iucha wrote:
> When 'big-copy' hangs, if I switch to a different console and run
> 'lsof', '[u]mount', or use shell completion on a network mount then that
> process goes into D state.  I cannot umount the network shares nor
> stop autofs.  I cannot do a clean reboot, I have to ssh
> in and "echo s > /proc/sysrq-trigger; echo u > /proc/sysrq-trigger;
> echo b > /proc/sysrq-trigger" .

What happens if you issue "echo 0 >/proc/sys/sunrpc/rpc_debug"?

> I am not mounting anything using CIFS, but I could give it a try.
> 
> I could transfer 75 GB without hiccup with 2.6.19 using NFS4 and CIFS,
> and with 2.6.20 using CIFS.  2.6.20 works fine under reasonably light
> load, with gnome sessions logging in and out several times a day.

How about NFSv3? I'd like to eliminate any issues with NFSv4 state.

I've also attached a little patch that I used in order to debug the list
consistency issues. Could you try it on top of the 4 I sent last night?

Cheers
  Trond



[-- Attachment #2: linux-2.6.21-031-debugging_do_not_merge.dif --]
[-- Type: message/rfc822, Size: 3135 bytes --]

From: Trond Myklebust <Trond.Myklebust@netapp.com>
Subject: No Subject
Date: Sun, 15 Apr 2007 19:02:47 -0400
Message-ID: <1176896287.6796.48.camel@heimdal.trondhjem.org>

Adds consistency checks for nfs_page list operations

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
---

 fs/nfs/write.c           |    8 ++++++--
 include/linux/nfs_page.h |    3 +++
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index cadbf3c..9be626d 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -194,6 +194,7 @@ static int nfs_writepage_setup(struct nfs_open_context *ctx, struct page *page,
 	nfs_grow_file(page, offset, count);
 	/* Set the PG_uptodate flag? */
 	nfs_mark_uptodate(page, offset, count);
+	WARN_ON(test_bit(PG_NEED_COMMIT,&(req)->wb_flags));
 	nfs_unlock_request(req);
 	return 0;
 }
@@ -459,6 +460,7 @@ nfs_mark_request_commit(struct nfs_page *req)
 	struct inode *inode = req->wb_context->dentry->d_inode;
 	struct nfs_inode *nfsi = NFS_I(inode);
 
+	WARN_ON(nfs_dirty_request(req));
 	spin_lock(&nfsi->req_lock);
 	nfs_list_add_request(req, &nfsi->commit);
 	nfsi->ncommit++;
@@ -552,7 +554,7 @@ static void nfs_cancel_commit_list(struct list_head *head)
 		req = nfs_list_entry(head->next);
 		dec_zone_page_state(req->wb_page, NR_UNSTABLE_NFS);
 		nfs_list_remove_request(req);
-		clear_bit(PG_NEED_COMMIT, &(req)->wb_flags);
+		WARN_ON(!test_and_clear_bit(PG_NEED_COMMIT,&(req)->wb_flags));
 		nfs_inode_remove_request(req);
 		nfs_unlock_request(req);
 	}
@@ -1033,6 +1035,7 @@ static void nfs_writeback_done_full(struct rpc_task *task, void *calldata)
 
 		if (nfs_write_need_commit(data)) {
 			memcpy(&req->wb_verf, &data->verf, sizeof(req->wb_verf));
+			set_bit(PG_NEED_COMMIT,&(req)->wb_flags);
 			nfs_mark_request_commit(req);
 			nfs_end_page_writeback(page);
 			dprintk(" marked for commit\n");
@@ -1206,6 +1209,7 @@ nfs_commit_list(struct inode *inode, struct list_head *head, int how)
 		nfs_list_remove_request(req);
 		nfs_mark_request_commit(req);
 		dec_zone_page_state(req->wb_page, NR_UNSTABLE_NFS);
+		WARN_ON(!test_and_clear_bit(PG_NEED_COMMIT,&(req)->wb_flags));
 		nfs_clear_page_writeback(req);
 	}
 	return -ENOMEM;
@@ -1229,7 +1233,7 @@ static void nfs_commit_done(struct rpc_task *task, void *calldata)
 	while (!list_empty(&data->pages)) {
 		req = nfs_list_entry(data->pages.next);
 		nfs_list_remove_request(req);
-		clear_bit(PG_NEED_COMMIT, &(req)->wb_flags);
+		WARN_ON(!test_and_clear_bit(PG_NEED_COMMIT,&(req)->wb_flags));
 		dec_zone_page_state(req->wb_page, NR_UNSTABLE_NFS);
 
 		dprintk("NFS: commit (%s/%Ld %d@%Ld)",
diff --git a/include/linux/nfs_page.h b/include/linux/nfs_page.h
index 41afab6..75c2d34 100644
--- a/include/linux/nfs_page.h
+++ b/include/linux/nfs_page.h
@@ -116,6 +116,9 @@ nfs_lock_request(struct nfs_page *req)
 static inline void
 nfs_list_add_request(struct nfs_page *req, struct list_head *head)
 {
+	BUG_ON(!list_empty(&req->wb_list));
+	BUG_ON(req->wb_list_head != NULL);
+
 	list_add_tail(&req->wb_list, head);
 	req->wb_list_head = head;
 }

  parent reply	other threads:[~2007-04-18 11:38 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20070416125905.GA2769@iucha.net>
     [not found] ` <1176736734.6761.45.camel@heimdal.trondhjem.org>
     [not found]   ` <Pine.LNX.4.64.0704160904560.5473@woody.linux-foundation.org>
     [not found]     ` <1176740307.6761.56.camel@heimdal.trondhjem.org>
     [not found]       ` <1176741408.6761.62.camel@heimdal.trondhjem.org>
     [not found]         ` <1176792399.3035.30.camel@twins>
     [not found]           ` <1176796503.3035.33.camel@twins>
2007-04-17 17:01             ` nfs: desynchronized value of nfs_i.ncommit OGAWA Hirofumi
2007-04-17 22:44               ` Trond Myklebust
2007-04-18  1:19               ` [PATCH 0/4] 2.6.21-rc7 NFS writes: fix a series of issues Trond Myklebust
2007-04-18  1:29                 ` [PATCH 1/4] NFS: clean up the unstable write code Trond Myklebust
2007-04-18  1:29                 ` [PATCH 2/4] NFS: Don't clear PG_writeback until after we've processed unstable writes Trond Myklebust
2007-04-18  1:29                 ` [PATCH 3/4] NFS: Fix the 'desynchronized value of nfs_i.ncommit' error Trond Myklebust
2007-04-18  1:29                 ` [PATCH 4/4] NFS: Fix race in nfs_set_page_dirty Trond Myklebust
2007-04-18  2:58                 ` [PATCH 0/4] 2.6.21-rc7 NFS writes: fix a series of issues Andrew Morton
2007-04-18  3:06                   ` Trond Myklebust
2007-04-18  3:30                     ` Florin Iucha
2007-04-18  3:54                       ` Trond Myklebust
2007-04-18  4:07                         ` Florin Iucha
2007-04-18  4:13                           ` Andrew Morton
2007-04-18  4:30                             ` Florin Iucha
2007-04-18  5:14                               ` Linus Torvalds
2007-04-18  5:26                                 ` Florin Iucha
2007-04-18  5:37                                 ` Andrew Morton
2007-04-18 12:38                                   ` Florin Iucha
2007-04-18 13:15                                     ` Trond Myklebust
2007-04-18 13:42                                       ` Florin Iucha
2007-04-18 14:11                                         ` Trond Myklebust
2007-04-18 14:17                                           ` Florin Iucha
2007-04-18 14:19                                             ` Trond Myklebust
2007-04-19  1:52                                           ` Florin Iucha
2007-04-19  2:45                                             ` Trond Myklebust
2007-04-19  4:38                                               ` Success! Was: " Florin Iucha
2007-04-19 15:12                                               ` Chuck Lever
2007-04-19 15:17                                                 ` Trond Myklebust
2007-04-19 15:50                                                   ` Florin Iucha
2007-04-19 16:09                                                     ` Trond Myklebust
2007-04-19 19:58                                                       ` Failure! " Florin Iucha
2007-04-19 21:30                                                         ` Trond Myklebust
2007-04-19 21:49                                                           ` Florin Iucha
2007-04-20 13:30                                                             ` Success! Was: " Florin Iucha
2007-04-20 13:37                                                               ` Trond Myklebust
2007-04-20 13:51                                                                 ` Florin Iucha
2007-04-18 14:14                                         ` Florin Iucha
2007-04-29 19:41                                   ` Rogier Wolff
2007-04-29 20:09                                     ` Peter Zijlstra
2007-04-18 11:38                           ` Trond Myklebust [this message]
2007-04-18  9:54                     ` OGAWA Hirofumi
2007-04-18  8:19                 ` Peter Zijlstra
2007-04-18 16:41                   ` Peter Zijlstra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1176896287.6796.47.camel@heimdal.trondhjem.org \
    --to=trond.myklebust@netapp.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=akpm@linux-foundation.org \
    --cc=bunk@stusta.de \
    --cc=florin@iucha.net \
    --cc=hirofumi@mail.parknet.co.jp \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®