From patchwork Thu Aug 2 12:40:11 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boaz Harrosh X-Patchwork-Id: 1267361 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 0A1AEDF223 for ; Thu, 2 Aug 2012 12:40:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753767Ab2HBMkY (ORCPT ); Thu, 2 Aug 2012 08:40:24 -0400 Received: from natasha.panasas.com ([67.152.220.90]:44530 "EHLO natasha.panasas.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753577Ab2HBMkY (ORCPT ); Thu, 2 Aug 2012 08:40:24 -0400 Received: from zenyatta.panasas.com (zenyatta.int.panasas.com [172.17.28.63]) by natasha.panasas.com (8.13.1/8.13.1) with ESMTP id q72CeMV3010213; Thu, 2 Aug 2012 08:40:22 -0400 Received: from [172.17.142.74] (172.17.142.74) by zenyatta.int.panasas.com (172.17.28.63) with Microsoft SMTP Server (TLS) id 14.1.355.2; Thu, 2 Aug 2012 08:39:46 -0400 Message-ID: <501A752B.9030702@panasas.com> Date: Thu, 2 Aug 2012 15:40:11 +0300 From: Boaz Harrosh User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20111113 Thunderbird/8.0 MIME-Version: 1.0 To: Trond Myklebust , NFS list , open-osd CC: Peng Tao Subject: [PATCH 3/3] pnfs: Don't BUG on info received from Server References: <501A7369.6090808@panasas.com> In-Reply-To: <501A7369.6090808@panasas.com> Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org 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 --- 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);