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 A696DC43387 for ; Mon, 7 Jan 2019 15:06:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 785D22089F for ; Mon, 7 Jan 2019 15:06:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1546873569; bh=jOWW9rleAf0ks3RCXM3erlYAcU7AttXUNcKI7ZyELEM=; h=Subject:To:Cc:From:Date:List-ID:From; b=vdsWjmQAI+jsEqBKUne5i7eVEsrWZO1TZfGdKjDnnWGZh2pEEGNVGV9yj6TKhJ4cE OrRL0N+mkUX2ylTx5VkhsMNCrjEfdPmTzXFQ1j5Ug/Bz28AC/wHXIMdGSw/8VJQIUw iCgKQKmEDn4D1p41+L+kKNxrxfBAi4Fptn2rdDE8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729347AbfAGPGI (ORCPT ); Mon, 7 Jan 2019 10:06:08 -0500 Received: from new4-smtp.messagingengine.com ([66.111.4.230]:36075 "EHLO new4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729090AbfAGPGI (ORCPT ); Mon, 7 Jan 2019 10:06:08 -0500 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailnew.nyi.internal (Postfix) with ESMTP id 84DEED39C; Mon, 7 Jan 2019 10:06:07 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Mon, 07 Jan 2019 10:06:07 -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=KbL4zQ OcaAZhE4cr3LIb68ql5s4/0B8AhGIF/iBTxII=; b=SFEyhiGo1hBZJgNXkB9WjK SZD9kyV5GPuTCNTLpd31y+Dh7axW9Qb5S0eJZRqQCoRd+tMVrX4pYU6Rpkg87IkJ MMPZTmuwybX5YMSNjqviR3ifEXYLATL2K6LJpm+xEKByKbd6crYMKwD1JGR6DT0C ejjF6jxMjjnCjlh/G7PbNUv1eAVjn0ALb7/OBIaPtmakGbL9FITeJyjy7QXNNlls aHUCQOg7GqC8WcEQslbws/habhdrMJEsgoJF9ydAF//dxbdgyUq08fs0qA2MEF3U PwnjeqDpW8Xhbu3FiR7asuEz4VLrcbbYE0Bjtb7SxZeq9PYIrEySpHJ1SA+3SfZg == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledrvdejgdejudculddtuddrgedtkedrtddtmd cutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthen uceurghilhhouhhtmecufedttdenucgoufhprghmkfhpucdlfedttddmnecujfgurhepuf fvhfffkfggtgfgsehtkeertddttdflnecuhfhrohhmpeeoghhrvghgkhhhsehlihhnuhig fhhouhhnuggrthhiohhnrdhorhhgqeenucfkphepkeefrdekiedrkeelrddutdejnecurf grrhgrmhepmhgrihhlfhhrohhmpehgrhgvgheskhhrohgrhhdrtghomhenucevlhhushht vghrufhiiigvpedu 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 BFFB1E464E; Mon, 7 Jan 2019 10:06:06 -0500 (EST) Subject: FAILED: patch "[PATCH] ext4: check for shutdown and r/o file system in" failed to apply to 4.9-stable tree To: tytso@mit.edu Cc: From: Date: Mon, 07 Jan 2019 16:06:05 +0100 Message-ID: <1546873565235108@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.9-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;