Linux NFS development
 help / color / mirror / Atom feed
From: Boaz Harrosh <bharrosh@panasas.com>
To: Trond Myklebust <Trond.Myklebust@netapp.com>,
	NFS list <linux-nfs@vger.kernel.org>,
	open-osd <osd-dev@open-osd.org>
Cc: Peng Tao <tao.peng@emc.com>
Subject: [PATCH 3/3] pnfs: Don't BUG on info received from Server
Date: Thu, 2 Aug 2012 15:40:11 +0300	[thread overview]
Message-ID: <501A752B.9030702@panasas.com> (raw)
In-Reply-To: <501A7369.6090808@panasas.com>


In nfs4_layoutreturn_done() there is a BUG_ON on a Server
returned member, when received in what the client thinks is
an impossible situation.

[The server returned ! lrp->res.lrs_present, but client
 still had more segments]

This BUG really hit me with the Linux pnfs Server, but
regardless of who is at fault here, Server or client, client
must not crash, even on a buggy Server.

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
---
 fs/nfs/nfs4proc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 15fc7e4..e25b686 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -6249,7 +6249,7 @@ static void nfs4_layoutreturn_done(struct rpc_task *task, void *calldata)
 		if (lrp->res.lrs_present) {
 			pnfs_set_layout_stateid(lo, &lrp->res.stateid, true);
 		} else
-			BUG_ON(!list_empty(&lo->plh_segs));
+			WARN_ON(!list_empty(&lo->plh_segs));
 	}
 	lo->plh_block_lgets--;
 	spin_unlock(&lo->plh_inode->i_lock);
-- 
1.7.10.2.677.gb6bc67f



      parent reply	other threads:[~2012-08-02 12:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-02 12:32 [PATCHSET 0/3] pnfs-obj: Fixes left-out from 3.5 for the 3.6 merge window Boaz Harrosh
2012-08-02 12:34 ` [PATCH 1/3] NFS41: add pg_layout_private to nfs_pageio_descriptor Boaz Harrosh
2012-08-02 12:36 ` [PATCH 1/3 repost] " Boaz Harrosh
2012-08-02 13:06   ` Boaz Harrosh
2012-08-02 12:38 ` [PATCH 2/3] pnfs-obj: Better IO pattern in case of unaligned offset Boaz Harrosh
2012-08-02 12:40 ` Boaz Harrosh [this message]

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=501A752B.9030702@panasas.com \
    --to=bharrosh@panasas.com \
    --cc=Trond.Myklebust@netapp.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=osd-dev@open-osd.org \
    --cc=tao.peng@emc.com \
    /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