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: 7702291 Return-Path: X-Original-To: patchwork-linux-block@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 4AC4E9F1BE for ; Wed, 25 Nov 2015 18:38:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7F2082087D for ; Wed, 25 Nov 2015 18:38:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9F11420877 for ; Wed, 25 Nov 2015 18:38:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752336AbbKYSiC (ORCPT ); Wed, 25 Nov 2015 13:38:02 -0500 Received: from mga09.intel.com ([134.134.136.24]:46293 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751495AbbKYSh7 (ORCPT ); Wed, 25 Nov 2015 13:37:59 -0500 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.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 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 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 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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(+) -- To unsubscribe from this list: send the line "unsubscribe linux-block" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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.