From patchwork Wed Dec 24 07:13:16 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Haynes X-Patchwork-Id: 5537221 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id EFABEBEEA8 for ; Wed, 24 Dec 2014 07:14:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 305C1201B9 for ; Wed, 24 Dec 2014 07:14:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5B02D200F2 for ; Wed, 24 Dec 2014 07:14:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751821AbaLXHON (ORCPT ); Wed, 24 Dec 2014 02:14:13 -0500 Received: from mail-ig0-f174.google.com ([209.85.213.174]:33536 "EHLO mail-ig0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751841AbaLXHOL (ORCPT ); Wed, 24 Dec 2014 02:14:11 -0500 Received: by mail-ig0-f174.google.com with SMTP id hn15so6575520igb.7 for ; Tue, 23 Dec 2014 23:14:10 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=c4+Cu8nDMbasm4dYZLXT3pModXnlkuDTXt7mRTz9DqY=; b=NPweItIKLl1G6dcVc2AVMt8oHetu3e0b/jMGaF+wWso3U4W8bAufZjqxvpFAx76T+i 6yR8enywuPkHKAsFM196+vSjMEYXrAwVwmq6vAxn7vbCFqZ/koTx+6cKZ2TyyNY/Lkx2 sjGmdFQ54NtMUuTZVHgu33TFm5EM7KytW+1jZNdMkBXJh8WCc4sPddHGsG5phAKLtqZZ WmshdWtd7RgEXC0nCeK5me4Csy0mLHKYH5Hl+akM5s9S0xEgq9T/9fmxhmCL1NnUKQqt RCDsmYBby5BNywFFExU+d21I9GD2gBfAtk9Gm2BhhXeORtv5p6cnMfA5/+uq9iVhwK+R FVhw== X-Gm-Message-State: ALoCoQlULBmFZ2PTm4Plqa/cZ/w0j+bbEloO2Wj7QJwf7PBBi/YskkVmp5GhX5dX7UGZhaFL9YMy X-Received: by 10.42.209.196 with SMTP id gh4mr25854895icb.10.1419405250577; Tue, 23 Dec 2014 23:14:10 -0800 (PST) Received: from localhost.localdomain (c-68-40-185-14.hsd1.mi.comcast.net. [68.40.185.14]) by mx.google.com with ESMTPSA id 37sm8821410iog.39.2014.12.23.23.14.09 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Dec 2014 23:14:10 -0800 (PST) From: Tom Haynes X-Google-Original-From: Tom Haynes To: Trond Myklebust Cc: Linux NFS Mailing List Subject: [PATCH v2 37/49] pnfs: fail comparison when bucket verifier not set Date: Tue, 23 Dec 2014 23:13:16 -0800 Message-Id: <1419405208-25975-38-git-send-email-loghyr@primarydata.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1419405208-25975-1-git-send-email-loghyr@primarydata.com> References: <1419405208-25975-1-git-send-email-loghyr@primarydata.com> Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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)); }