From patchwork Wed Apr 8 14:41:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Tao X-Patchwork-Id: 6180681 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 C2E97BF4A6 for ; Wed, 8 Apr 2015 14:42:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E22F52028D for ; Wed, 8 Apr 2015 14:42:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0C2522027D for ; Wed, 8 Apr 2015 14:42:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932371AbbDHOmH (ORCPT ); Wed, 8 Apr 2015 10:42:07 -0400 Received: from mail-pd0-f181.google.com ([209.85.192.181]:35561 "EHLO mail-pd0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753841AbbDHOmE (ORCPT ); Wed, 8 Apr 2015 10:42:04 -0400 Received: by pddn5 with SMTP id n5so117561215pdd.2 for ; Wed, 08 Apr 2015 07:42:04 -0700 (PDT) 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; bh=E2Y9EixNsRN/wZJ8R5s1eR2CS59eWmJsKhaMQS6PhdA=; b=Fk4ouRf64iEdQ23jBK/Kr3GrgoMzWJAJ2hbEZghyW0N9lZ//BIOss6CxlnGd+luDNF yVZI4UMt7vYdP7LZdBpZIrEH1M3ceHBQT3Z9XRCj7GQbKvLvYg2iz32R3lcv382fQVjA 3OXiQ//8nSa86Clbsx5qll4X3ZF6kZJPHSyGYHVHp422wNF+UhBDHX+0TjXxZm2ujyZu 967v2hTAClD+M5OPHAqmANqAkRmtUkJFiSfaOBAmHynsE5V9DqcDi5BqL//r80/79Snn NHuYD6qjtUAJdWkI78zxb1ER0m4HX26oRTtv7x+VZ1oNUFQLla6DlKN/D5qeBVyq+TCS OeXw== X-Gm-Message-State: ALoCoQnkZETMzOayS9/KlJarFk/UAPQKIUHOPddqGiTH8RgQj1xIRt1el4hrFLfQyILQZ48yWlkp X-Received: by 10.66.136.48 with SMTP id px16mr47311404pab.89.1428504124157; Wed, 08 Apr 2015 07:42:04 -0700 (PDT) Received: from localhost.localdomain (ec2-54-65-164-9.ap-northeast-1.compute.amazonaws.com. [54.65.164.9]) by mx.google.com with ESMTPSA id fn6sm920334pab.31.2015.04.08.07.41.59 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 08 Apr 2015 07:42:03 -0700 (PDT) From: Peng Tao To: linux-nfs@vger.kernel.org Cc: Trond Myklebust , Peng Tao , Weston Andros Adamson Subject: [PATCH] nfs: remove WARN_ON_ONCE from nfs_direct_good_bytes Date: Wed, 8 Apr 2015 22:41:23 +0800 Message-Id: <1428504083-8227-1-git-send-email-tao.peng@primarydata.com> X-Mailer: git-send-email 1.9.1 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 For flexfiles driver, we might choose to read from mirror index other than 0 while mirror_count is always 1 for read. Reported-by: Jean Spector Cc: Weston Andros Adamson Signed-off-by: Peng Tao --- fs/nfs/direct.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c index 645109e..0c84f67 100644 --- a/fs/nfs/direct.c +++ b/fs/nfs/direct.c @@ -129,8 +129,6 @@ nfs_direct_good_bytes(struct nfs_direct_req *dreq, struct nfs_pgio_header *hdr) int i; ssize_t count; - WARN_ON_ONCE(hdr->pgio_mirror_idx >= dreq->mirror_count); - count = dreq->mirrors[hdr->pgio_mirror_idx].count; if (count + dreq->io_start < hdr->io_start + hdr->good_bytes) dreq->mirrors[hdr->pgio_mirror_idx].count += hdr->good_bytes;