From patchwork Mon Feb 2 22:38:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Haynes X-Patchwork-Id: 5765081 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 171679F693 for ; Mon, 2 Feb 2015 22:41:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3F0FE209EA for ; Mon, 2 Feb 2015 22:41:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CE068209EF for ; Mon, 2 Feb 2015 22:40:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965365AbbBBWk5 (ORCPT ); Mon, 2 Feb 2015 17:40:57 -0500 Received: from mail-pa0-f42.google.com ([209.85.220.42]:49656 "EHLO mail-pa0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965072AbbBBWk5 (ORCPT ); Mon, 2 Feb 2015 17:40:57 -0500 Received: by mail-pa0-f42.google.com with SMTP id bj1so88034780pad.1 for ; Mon, 02 Feb 2015 14:40:57 -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=NDIIDLUE7g1CUH/xbHqbiggxvJK6ESrOGlBvceAvYmc=; b=Tlfw/c1iIyBtM3t2OzpH0mQyOxs52URhIoxqYxj6pd0soMUXYejhIDaBNkIUZ4eMFY xaQO88Gfi6xJ2ugYXUaBtEj7wTbHsy15VoLbR989f9lDOuxGoXkoG54t1tQSiDaD6VSW uzOm9jUrzIL90/xaL0ceZ1FpJTWsQYB8+DnUtEnnrUXAOHNvzExtwFnkvxfx/hPT7us2 8ZNwMmafXUuxlIdKEuMONZ1iNSfJDxDn79zO9nU4nD0sWlPqH59IUUbOnZb4NyZsMOlb EDEW4U9C0/xMn2qgeNtgswTOladTGHyv4Yq8dUbmZKejKny1FawcHKyrZ7LWyQLHSkci uWEA== X-Gm-Message-State: ALoCoQll+R/OW7VeMfwzxQfZBlGsy/VzGVmzSvIEOXQf6e7+I50Dfl49l9BlS5NsPrp6RGZr0/qW X-Received: by 10.68.197.133 with SMTP id iu5mr32978305pbc.131.1422916856897; Mon, 02 Feb 2015 14:40:56 -0800 (PST) Received: from localhost.localdomain ([50.242.95.105]) by mx.google.com with ESMTPSA id bx13sm94656pdb.19.2015.02.02.14.40.55 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Feb 2015 14:40:56 -0800 (PST) From: Tom Haynes X-Google-Original-From: Tom Haynes To: Trond Myklebust Cc: Linux NFS Mailing list Subject: [PATCH v6 37/53] pnfs: fail comparison when bucket verifier not set Date: Mon, 2 Feb 2015 14:38:51 -0800 Message-Id: <1422916747-86649-38-git-send-email-loghyr@primarydata.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1422916747-86649-1-git-send-email-loghyr@primarydata.com> References: <1422916747-86649-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 23ee1bc..c26cc22 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)); }