From patchwork Wed Jan 7 00:28:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Haynes X-Patchwork-Id: 5578331 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 551849F507 for ; Wed, 7 Jan 2015 00:30:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8AA222024F for ; Wed, 7 Jan 2015 00:30:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B0FC72024C for ; Wed, 7 Jan 2015 00:29:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754742AbbAGA3x (ORCPT ); Tue, 6 Jan 2015 19:29:53 -0500 Received: from mail-pa0-f50.google.com ([209.85.220.50]:40711 "EHLO mail-pa0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756123AbbAGA3u (ORCPT ); Tue, 6 Jan 2015 19:29:50 -0500 Received: by mail-pa0-f50.google.com with SMTP id bj1so1068186pad.9 for ; Tue, 06 Jan 2015 16:29:50 -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=D19XKbJPBmhposzKhfOkO6adW3nU9SbTxL2AN0Kl3Y99V+De0lrJfS7AWWJvUFJmnl VUSDr2PveuSB1jNGfP5qV6h4W0CcMtq3E3OphJQQ0vYFzixKVDbfEA96cmEEuVtqDi9A UWT178Io2ySeAijMw9xYbwpvAob4iAqMIZA79iXAlQRYRmLGIEH5umRGIxNVK9eTI6GO w3NAtqH8oyaMh38WAlRfjvxrc3uHw8YmEmm2n8cbt4rQznDe60TR8jH7UAdw4DzMGe9f XFK2uRhFvGwBKgb/Iz+At5m634/lLZ3LhtnX8nQyUa3t0gB5JNoCgUr1WVUHwfvk1mLA bJug== X-Gm-Message-State: ALoCoQnvGICs9HTv58xG36+NZ4rV7g8SybZEI/H2NJ9fUFatbgi1pxVMp5x/wXC45+CDwwpUVcYc X-Received: by 10.70.101.134 with SMTP id fg6mr84281pdb.75.1420590590204; Tue, 06 Jan 2015 16:29:50 -0800 (PST) Received: from localhost.localdomain ([50.242.95.105]) by mx.google.com with ESMTPSA id wi15sm53763pac.21.2015.01.06.16.29.49 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Jan 2015 16:29:49 -0800 (PST) From: Tom Haynes X-Google-Original-From: Tom Haynes To: Trond Myklebust Cc: Linux NFS Mailing list Subject: [PATCH v3 37/49] pnfs: fail comparison when bucket verifier not set Date: Tue, 6 Jan 2015 16:28:42 -0800 Message-Id: <1420590534-84063-38-git-send-email-loghyr@primarydata.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1420590534-84063-1-git-send-email-loghyr@primarydata.com> References: <1420590534-84063-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)); }