Return-Path: linux-nfs-owner@vger.kernel.org Received: from mail-pd0-f172.google.com ([209.85.192.172]:42237 "EHLO mail-pd0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754432AbbAVXiJ (ORCPT ); Thu, 22 Jan 2015 18:38:09 -0500 Received: by mail-pd0-f172.google.com with SMTP id v10so4631613pde.3 for ; Thu, 22 Jan 2015 15:38:08 -0800 (PST) From: Tom Haynes To: Trond Myklebust Cc: Linux NFS Mailing list Subject: [PATCH v5 37/51] pnfs: fail comparison when bucket verifier not set Date: Thu, 22 Jan 2015 15:36:09 -0800 Message-Id: <1421969783-92997-38-git-send-email-loghyr@primarydata.com> In-Reply-To: <1421969783-92997-1-git-send-email-loghyr@primarydata.com> References: <1421969783-92997-1-git-send-email-loghyr@primarydata.com> Sender: linux-nfs-owner@vger.kernel.org List-ID: From: Weston Andros Adamson This skips the WARN_ON_ONCE, but doesnt change behavior (the memcmp would fail). Signed-off-by: Weston Andros Adamson Signed-off-by: Tom Haynes --- fs/nfs/direct.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c index 651387b..eb81478 100644 --- a/fs/nfs/direct.c +++ b/fs/nfs/direct.c @@ -222,7 +222,11 @@ static int nfs_direct_cmp_commit_data_verf(struct nfs_direct_req *dreq, verfp = nfs_direct_select_verf(dreq, data->ds_clp, data->ds_commit_index); - WARN_ON_ONCE(verfp->committed < 0); + + /* verifier not set so always fail */ + if (verfp->committed < 0) + return 1; + return memcmp(verfp, &data->verf, sizeof(struct nfs_writeverf)); } -- 1.9.3