From patchwork Thu Jan 22 23:36:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Haynes X-Patchwork-Id: 5689681 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.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 6B43FC058D for ; Thu, 22 Jan 2015 23:38:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9E7CD2011D for ; Thu, 22 Jan 2015 23:38:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CA4B02010B for ; Thu, 22 Jan 2015 23:38:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754585AbbAVXiJ (ORCPT ); Thu, 22 Jan 2015 18:38:09 -0500 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) 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=kMPKRoT6b1y0YwcW6Hm/H9E+9asDtPn9whsCuAxRKYcAZ5bgCxQCR3Eg/W9mqar6E/ nRlAPW+McaUAUIV9hx4yMZ33OJ9Gh6kqI91xt1Jg8d1P7ldpu7GuBnXM99E1iAY6wiDo +wdXdbSlGz0m12oKTxxAs6PQzVmNk7JLvO2zN9EXKPfd7ydBihXrtSUortyorRPScQUP UI8fSMGvsJyBG1F8KyJ74GVOibyMlcgZXoPDAAkq/tYOMgxhbjXTqECBYZqDG6rtuQyJ R8PDYHTRdflTab50iuuBdRHy3zqoQ/LUeSWfObTYgmvf+XZoXo9EBC0TNcr1p9zKzryf DfTA== X-Gm-Message-State: ALoCoQkWvpWiDplxx6MQ2QYB6V120bwEfHxIIqiRhv99eOFeInmSKbWcekKw4OlVb95qYXDJ8Fnx X-Received: by 10.66.141.109 with SMTP id rn13mr6177191pab.113.1421969888670; Thu, 22 Jan 2015 15:38:08 -0800 (PST) Received: from localhost.localdomain ([50.242.95.105]) by mx.google.com with ESMTPSA id fu1sm366817pdb.80.2015.01.22.15.38.06 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Jan 2015 15:38:07 -0800 (PST) From: Tom Haynes X-Google-Original-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> X-Mailer: git-send-email 1.9.3 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 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)); }