All of lore.kernel.org
 help / color / mirror / Atom feed
From: Trond Myklebust <Trond.Myklebust@netapp.com>
To: linux-nfs@vger.kernel.org
Cc: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>,
	Boaz Harrosh <bharrosh@panasas.com>,
	Benny Halevy <bhalevy@tonian.com>,
	Fred Isaman <Fred.Isaman@netapp.com>
Subject: [PATCH] NFSv4.1: Remove a bogus BUG_ON() in nfs4_layoutreturn_done
Date: Wed,  8 Aug 2012 16:21:50 -0400	[thread overview]
Message-ID: <1344457310-26442-1-git-send-email-Trond.Myklebust@netapp.com> (raw)

Ever since commit 0a57cdac3f (NFSv4.1 send layoutreturn to fence
disconnected data server) we've been sending layoutreturn calls
while there is potentially still outstanding I/O to the data
servers. The reason we do this is to avoid races between replayed
writes to the MDS and the original writes to the DS.

When this happens, the BUG_ON() in nfs4_layoutreturn_done can
be triggered because it assumes that we would never call
layoutreturn without knowing that all I/O to the DS is
finished. The fix is to remove the BUG_ON() now that the
assumptions behind the test are obsolete.

Reported-by: Boaz Harrosh <bharrosh@panasas.com>
Reported-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: stable@vger.kernel.org [>=3.5]
---
 fs/nfs/nfs4proc.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index f94f6b3..c77d296 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -6359,12 +6359,8 @@ static void nfs4_layoutreturn_done(struct rpc_task *task, void *calldata)
 		return;
 	}
 	spin_lock(&lo->plh_inode->i_lock);
-	if (task->tk_status == 0) {
-		if (lrp->res.lrs_present) {
-			pnfs_set_layout_stateid(lo, &lrp->res.stateid, true);
-		} else
-			BUG_ON(!list_empty(&lo->plh_segs));
-	}
+	if (task->tk_status == 0 && lrp->res.lrs_present)
+		pnfs_set_layout_stateid(lo, &lrp->res.stateid, true);
 	lo->plh_block_lgets--;
 	spin_unlock(&lo->plh_inode->i_lock);
 	dprintk("<-- %s\n", __func__);
-- 
1.7.11.2


             reply	other threads:[~2012-08-08 20:22 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-08 20:21 Trond Myklebust [this message]
2012-08-09 14:30 ` [PATCH] NFSv4.1: Remove a bogus BUG_ON() in nfs4_layoutreturn_done Peng Tao
2012-08-09 14:36   ` Myklebust, Trond
2012-08-09 15:01     ` Peng Tao
2012-08-09 15:39       ` Myklebust, Trond
2012-08-09 16:22         ` Peng Tao
2012-08-09 16:29           ` Myklebust, Trond
2012-08-09 16:40             ` Peng Tao
2012-08-09 17:06             ` Peng Tao
2012-08-12 17:36         ` Boaz Harrosh
2012-08-13 16:26           ` Myklebust, Trond
2012-08-13 23:39             ` Boaz Harrosh
2012-08-14  0:16               ` Myklebust, Trond
2012-08-14  0:28                 ` Boaz Harrosh
2012-08-14  0:49                   ` Myklebust, Trond
     [not found]           ` <1344875167.7706.31.camel@lade.trondhjem.org>
2012-08-13 16:58             ` Myklebust, Trond
2012-08-14  7:48         ` Benny Halevy
2012-08-14 13:45           ` Myklebust, Trond
2012-08-14 14:30             ` Peng Tao
2012-08-14 14:53               ` Myklebust, Trond
2012-08-15 11:50                 ` Benny Halevy

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=1344457310-26442-1-git-send-email-Trond.Myklebust@netapp.com \
    --to=trond.myklebust@netapp.com \
    --cc=Fred.Isaman@netapp.com \
    --cc=bhalevy@tonian.com \
    --cc=bharrosh@panasas.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=tigran.mkrtchyan@desy.de \
    /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 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.