From patchwork Wed Nov 25 18:37:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Williams X-Patchwork-Id: 7702201 Return-Path: X-Original-To: patchwork-linux-nvdimm@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 E07889F1BE for ; Wed, 25 Nov 2015 18:38:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 162DA20877 for ; Wed, 25 Nov 2015 18:38:11 +0000 (UTC) Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2B81620867 for ; Wed, 25 Nov 2015 18:38:10 +0000 (UTC) Received: from ml01.vlan14.01.org (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 204F01A202C; Wed, 25 Nov 2015 10:38:10 -0800 (PST) X-Original-To: linux-nvdimm@lists.01.org Delivered-To: linux-nvdimm@lists.01.org Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by ml01.01.org (Postfix) with ESMTP id DB23C1A202C for ; Wed, 25 Nov 2015 10:38:08 -0800 (PST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP; 25 Nov 2015 10:37:59 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,343,1444719600"; d="scan'208";a="828978477" Received: from dwillia2-desk3.jf.intel.com (HELO dwillia2-desk3.amr.corp.intel.com) ([10.54.39.39]) by orsmga001.jf.intel.com with ESMTP; 25 Nov 2015 10:37:58 -0800 Subject: [PATCH v2 6/7] ext4: skip inode dirty when backing device is gone From: Dan Williams To: linux-nvdimm@lists.01.org Date: Wed, 25 Nov 2015 10:37:29 -0800 Message-ID: <20151125183729.12508.60473.stgit@dwillia2-desk3.amr.corp.intel.com> In-Reply-To: <20151125183656.12508.52212.stgit@dwillia2-desk3.amr.corp.intel.com> References: <20151125183656.12508.52212.stgit@dwillia2-desk3.amr.corp.intel.com> User-Agent: StGit/0.17.1-9-g687f MIME-Version: 1.0 Cc: Theodore Ts'o , Dave Chinner , linux-block@vger.kernel.org, Andreas Dilger , Jan Kara , linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org X-BeenThere: linux-nvdimm@lists.01.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "Linux-nvdimm developer list." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 Use SB_I_BDI_DEAD to prevent dirtying an inode after a del_gendisk() event. WARNING: CPU: 0 PID: 2133 at fs/fs-writeback.c:2065 __mark_inode_dirty+0x261/0x350() bdi-block not registered [..] Call Trace: [] dump_stack+0x44/0x62 [] warn_slowpath_common+0x82/0xc0 [] warn_slowpath_fmt+0x5c/0x80 [] __mark_inode_dirty+0x261/0x350 [] generic_update_time+0x79/0xd0 [] file_update_time+0xbd/0x110 [] ext4_dax_fault+0x68/0x110 [] __do_fault+0x4e/0xf0 [] handle_mm_fault+0x5e7/0x1b50 [] ? handle_mm_fault+0x51/0x1b50 [] __do_page_fault+0x191/0x3f0 [] trace_do_page_fault+0x4f/0x120 [] do_async_page_fault+0x1a/0xa0 [] async_page_fault+0x28/0x30 Cc: Jan Kara Cc: "Theodore Ts'o" Cc: Andreas Dilger Cc: linux-ext4@vger.kernel.org Suggested-by: Dave Chinner Signed-off-by: Dan Williams --- fs/fs-writeback.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c index 023f6a1f23cd..33e8b24f78ab 100644 --- a/fs/fs-writeback.c +++ b/fs/fs-writeback.c @@ -2005,6 +2005,9 @@ void __mark_inode_dirty(struct inode *inode, int flags) flags &= ~I_DIRTY_TIME; dirtytime = flags & I_DIRTY_TIME; + if (sb->s_iflags & SB_I_BDI_DEAD) + return; + /* * Paired with smp_mb() in __writeback_single_inode() for the * following lockless i_state test. See there for details.