From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.6 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 99CBCC43387 for ; Mon, 7 Jan 2019 15:05:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5E5512089F for ; Mon, 7 Jan 2019 15:05:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1546873557; bh=229CrZ9FJWXSb2ZckxZFF+rp6uRBgdPTv8aSTAN4WmI=; h=Subject:To:Cc:From:Date:List-ID:From; b=l1JWPZfZZyzvwulCQRyrlzaz61u6pmrQSWg9RsTN1x98BDXEwqxtikuIGCKa20aTK 4uiBjl49hRGvSb86mMeu0sxSBA28kMWp8pyZZEpgb+ipeOCcadMsgUSAKEBkeOrrT6 I7nSbNAC/mAwmek2xChiLWBSvtk9ETwejFUrEvKM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729047AbfAGPF4 (ORCPT ); Mon, 7 Jan 2019 10:05:56 -0500 Received: from new4-smtp.messagingengine.com ([66.111.4.230]:45201 "EHLO new4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727355AbfAGPF4 (ORCPT ); Mon, 7 Jan 2019 10:05:56 -0500 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailnew.nyi.internal (Postfix) with ESMTP id 8F073110AF; Mon, 7 Jan 2019 10:05:55 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Mon, 07 Jan 2019 10:05:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=VoUXCb /JiiMO2o2bkby6urwj9xhBamO8Z5No+E8bbnM=; b=bMxyIyKuqzefn6UrJ/7AFd 1A+0ERV0TfCzyrRnD2p0DeYpFTtXTeqLRdc1P7HBgA04lBoX26SYIQJ/fOPLOZR9 NxFyannggynhuathSjjiWouarZgUy4if8It6LtoVv2sWpMtdo7m4nEI5rTVAuQpL Dmt/l7+UWAosPLFM/vSoZOBa0t1Kc0raBddPmXBVs3+Sg/Sq15tI3c7BMiq5Qlri eTp5ktOIICOH22tt0/q2Rc6RKAq/RosuQi9IktobmaP26nzpPdcxdWzRLHTMRR9z 8NiS3xBorijj7u8kvB4DJZk9OyhjO8g66e2hXB4IOe1anSXc17bMKW/Pd9qdnXxg == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledrvdejgdejudculddtuddrgedtkedrtddtmd cutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthen uceurghilhhouhhtmecufedttdenucgoufhprghmkfhpucdlfedttddmnecujfgurhepuf fvhfffkfggtgfgsehtkeertddttdflnecuhfhrohhmpeeoghhrvghgkhhhsehlihhnuhig fhhouhhnuggrthhiohhnrdhorhhgqeenucfkphepkeefrdekiedrkeelrddutdejnecurf grrhgrmhepmhgrihhlfhhrohhmpehgrhgvgheskhhrohgrhhdrtghomhenucevlhhushht vghrufhiiigvpedt X-ME-Proxy: Received: from localhost (5356596b.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) by mail.messagingengine.com (Postfix) with ESMTPA id 84157E4664; Mon, 7 Jan 2019 10:05:54 -0500 (EST) Subject: FAILED: patch "[PATCH] ext4: check for shutdown and r/o file system in" failed to apply to 4.14-stable tree To: tytso@mit.edu Cc: From: Date: Mon, 07 Jan 2019 16:05:53 +0100 Message-ID: <1546873553166102@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org The patch below does not apply to the 4.14-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 18f2c4fcebf2582f96cbd5f2238f4f354a0e4847 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Wed, 19 Dec 2018 14:36:58 -0500 Subject: [PATCH] ext4: check for shutdown and r/o file system in ext4_write_inode() If the file system has been shut down or is read-only, then ext4_write_inode() needs to bail out early. Also use jbd2_complete_transaction() instead of ext4_force_commit() so we only force a commit if it is needed. Signed-off-by: Theodore Ts'o Cc: stable@kernel.org diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 664b434ba836..9affabd07682 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -5400,9 +5400,13 @@ int ext4_write_inode(struct inode *inode, struct writeback_control *wbc) { int err; - if (WARN_ON_ONCE(current->flags & PF_MEMALLOC)) + if (WARN_ON_ONCE(current->flags & PF_MEMALLOC) || + sb_rdonly(inode->i_sb)) return 0; + if (unlikely(ext4_forced_shutdown(EXT4_SB(inode->i_sb)))) + return -EIO; + if (EXT4_SB(inode->i_sb)->s_journal) { if (ext4_journal_current_handle()) { jbd_debug(1, "called recursively, non-PF_MEMALLOC!\n"); @@ -5418,7 +5422,8 @@ int ext4_write_inode(struct inode *inode, struct writeback_control *wbc) if (wbc->sync_mode != WB_SYNC_ALL || wbc->for_sync) return 0; - err = ext4_force_commit(inode->i_sb); + err = jbd2_complete_transaction(EXT4_SB(inode->i_sb)->s_journal, + EXT4_I(inode)->i_sync_tid); } else { struct ext4_iloc iloc;