From patchwork Fri Aug 8 15:13:33 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Weston Andros Adamson X-Patchwork-Id: 4696751 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A59299F377 for ; Fri, 8 Aug 2014 15:15:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CD5A5201BA for ; Fri, 8 Aug 2014 15:15:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DCE1C201C0 for ; Fri, 8 Aug 2014 15:15:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756501AbaHHPPA (ORCPT ); Fri, 8 Aug 2014 11:15:00 -0400 Received: from mail-ig0-f181.google.com ([209.85.213.181]:61388 "EHLO mail-ig0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756256AbaHHPO7 (ORCPT ); Fri, 8 Aug 2014 11:14:59 -0400 Received: by mail-ig0-f181.google.com with SMTP id h3so1175763igd.14 for ; Fri, 08 Aug 2014 08:14:59 -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:in-reply-to :references; bh=pTZz2clkEfD9buR0FHldUfIRdzmS25TM1Z/ZcEnFVgw=; b=UitFiXLPJyIlSZHSZbovL7tuW1r9thZ1gRs5AouuUCan4RsLEIJzFAcvvoFxvQfTma fQ6oko367ct7MF0wjS0yCuRibaBTHAKzmg4GBZePoCNGPSLij30JUD6+B1F/uYCIqK0w cwB+wG3Pgw6+15uJDfWKNN0c1sSK4kID+Ujj8aWE62RmVKvVa3mObSgL1YblrRojSBFc xsqcYRYGIZgU7Ky1WIRRtxtfpkryM+nET+2lfTVaMnahLWJa9e1uATmjYfHYrapqjHj8 Us76jcM0CssSptQQ88EAEBHVQYdJUu962Zfoyr8uGBD2iNL+0l8vv7SurzWkD15z3IYv L50A== X-Gm-Message-State: ALoCoQkF9N7QVAqJA3QlApYJ7kZ+zb9WHSPn1PPZ5C9yajB4+BwbgO6vQBkmZgT1iBsaaW4RL3+J X-Received: by 10.50.35.133 with SMTP id h5mr6122378igj.26.1407510899043; Fri, 08 Aug 2014 08:14:59 -0700 (PDT) Received: from gavrio-wifi.robotsandstuff.fake (c-98-209-19-144.hsd1.mi.comcast.net. [98.209.19.144]) by mx.google.com with ESMTPSA id lb2sm10093951igb.6.2014.08.08.08.14.58 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 08 Aug 2014 08:14:58 -0700 (PDT) From: Weston Andros Adamson To: trond.myklebust@primarydata.com Cc: linux-nfs@vger.kernel.org, Weston Andros Adamson Subject: [PATCH 2/5] nfs: fix comment and add warn_on for PG_INODE_REF Date: Fri, 8 Aug 2014 11:13:33 -0400 Message-Id: <1407510816-7002-3-git-send-email-dros@primarydata.com> X-Mailer: git-send-email 1.8.5.2 (Apple Git-48) In-Reply-To: <1407510816-7002-1-git-send-email-dros@primarydata.com> References: <1407510816-7002-1-git-send-email-dros@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=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 Fix the comment in nfs_page.h for PG_INODE_REF to reflect that it's no longer set only on head requests. Also add a WARN_ON_ONCE in nfs_inode_remove_request as PG_INODE_REF should always be set. Suggested-by: Peng Tao Signed-off-by: Weston Andros Adamson Signed-off-by: Trond Myklebust --- fs/nfs/write.c | 2 ++ include/linux/nfs_page.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/nfs/write.c b/fs/nfs/write.c index 8d1ed2b..e6bc5b5 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c @@ -707,6 +707,8 @@ static void nfs_inode_remove_request(struct nfs_page *req) if (test_and_clear_bit(PG_INODE_REF, &req->wb_flags)) nfs_release_request(req); + else + WARN_ON_ONCE(1); } static void diff --git a/include/linux/nfs_page.h b/include/linux/nfs_page.h index 291924c..6ad2bbc 100644 --- a/include/linux/nfs_page.h +++ b/include/linux/nfs_page.h @@ -26,7 +26,7 @@ enum { PG_MAPPED, /* page private set for buffered io */ PG_CLEAN, /* write succeeded */ PG_COMMIT_TO_DS, /* used by pnfs layouts */ - PG_INODE_REF, /* extra ref held by inode (head req only) */ + PG_INODE_REF, /* extra ref held by inode when in writeback */ PG_HEADLOCK, /* page group lock of wb_head */ PG_TEARDOWN, /* page group sync for destroy */ PG_UNLOCKPAGE, /* page group sync bit in read path */