From patchwork Tue Dec 16 19:01:40 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Haynes X-Patchwork-Id: 5503111 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 1B527BEEBA for ; Tue, 16 Dec 2014 19:03:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 641F720A16 for ; Tue, 16 Dec 2014 19:03:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7E870209C4 for ; Tue, 16 Dec 2014 19:03:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751265AbaLPTDP (ORCPT ); Tue, 16 Dec 2014 14:03:15 -0500 Received: from mail-pd0-f176.google.com ([209.85.192.176]:60529 "EHLO mail-pd0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751312AbaLPTDO (ORCPT ); Tue, 16 Dec 2014 14:03:14 -0500 Received: by mail-pd0-f176.google.com with SMTP id r10so12473882pdi.21 for ; Tue, 16 Dec 2014 11:03:13 -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=NfEgNavPiAN5/LcHDxWV30qrYLo7lSkJYG9Iat900Gd8zIIlzg/jiHip3chfj9QvOM dMemDLnEV5DU6a9NBtmUTfYLKhjo1gd7NqTLTMgnsDrnm9DrXjnC1qxtMvrWwMg4Zz1h hM1BfXaxlFskWVplKbAWIBNmnOgSt2AvFJ66cIh8rVbUAM1vfWprb7UtFUtjXCNGFj0S YO93NsuK/+KenNICewRCGv08Ui24kJ1avq1sQO5+VKCxDDsZQDu48a/LyVEm4cOCBtER 5wPqFXV7tugUWqczUhOJQTu0Jk0H+0wlytyVahRQ3koswadIbjWkWDTbIESTNpKkQ5uE /1tg== X-Gm-Message-State: ALoCoQlh92MIlZT2o7zTjFnL9ATwm2awf2gpskUia230hgGWuhjei4zySwQuNDaepYJ66ZYQzDV2 X-Received: by 10.68.69.1 with SMTP id a1mr63878041pbu.162.1418756593741; Tue, 16 Dec 2014 11:03:13 -0800 (PST) Received: from localhost.localdomain ([50.242.95.105]) by mx.google.com with ESMTPSA id q4sm1620669pdh.79.2014.12.16.11.03.12 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Dec 2014 11:03:13 -0800 (PST) From: Tom Haynes X-Google-Original-From: Tom Haynes To: Trond Myklebust Cc: Linux NFS Mailing List Subject: [PATCH 37/50] pnfs: fail comparison when bucket verifier not set Date: Tue, 16 Dec 2014 11:01:40 -0800 Message-Id: <1418756513-95187-38-git-send-email-loghyr@primarydata.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1418756513-95187-1-git-send-email-loghyr@primarydata.com> References: <1418756513-95187-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)); }