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=-9.4 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 87FEEC43387 for ; Sun, 6 Jan 2019 10:40:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 549D2217F9 for ; Sun, 6 Jan 2019 10:40:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1546771227; bh=gAmTJlJsWXGvHThBC6JITm5CqILtgGJe1gzWoXhAXfs=; h=Subject:To:Cc:From:Date:List-ID:From; b=tjyAyiNQTcmKk3tU+ydD3ulhwCYSSzMYnrO4iXJve9yHAUUywLsvT9h/eRwYBOpRt Nz5mvwFWF45pWjPFUVNBG+Ioz/O/SpT+omXsBMNBWR+cxk5X/twZstwexn8BgmEVvG ZCJTc9SqV5MYIAMhcUrrR27DEnlcF3s4eYMK1gec= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726151AbfAFKk0 (ORCPT ); Sun, 6 Jan 2019 05:40:26 -0500 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:36557 "EHLO out1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726053AbfAFKk0 (ORCPT ); Sun, 6 Jan 2019 05:40:26 -0500 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 3007B21FD9; Sun, 6 Jan 2019 05:40:23 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Sun, 06 Jan 2019 05:40:23 -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=aedx7s LEepbb6Iv9Ey3LeS6UvGlOyujuYT6HHn5yhvU=; b=EbP55kK83WLGE0iKdzxEMF 1u/eiTzsUp34DgdAhDqrVZyIEsZU58w7PNMtE+3yREvXj4o3tL6DR34rdvikhaI3 ntiUyzsZ10fxgDpP7oKOmFp65fRL6bxYoxEDs7D0BH3cpdYmVE9PY/4b8AISr8gf ZBC7P8MJDxT4jU0Wq6klmNCvU2zqm+VWvK4BZOyMul2BPH1EzyykfDSjEDFJ/vd9 5wc0jWzQyvrqcv7NrElhIdXb5orbBtQgnmvF9sHCCJ1GBdPEnajZI8hxi/m79uL0 3tzLbENsJ8rBx8TMjJrIElGJb2h4+ERbmQvQKtxG+9YR9cbgblyO0J6zBG4Ud7cA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledrvdehgddvtdculddtuddrgedtkedrtddtmd cutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthen uceurghilhhouhhtmecufedttdenucenucfjughrpefuvffhfffkgggtgfesthekredttd dtlfenucfhrhhomhepoehgrhgvghhkhheslhhinhhugihfohhunhgurghtihhonhdrohhr gheqnecukfhppeekfedrkeeirdekledruddtjeenucfrrghrrghmpehmrghilhhfrhhomh epghhrvghgsehkrhhorghhrdgtohhmnecuvehluhhsthgvrhfuihiivgeptd 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 4A72710087; Sun, 6 Jan 2019 05:40:22 -0500 (EST) Subject: FAILED: patch "[PATCH] ext4: check for shutdown and r/o file system in" failed to apply to 4.4-stable tree To: tytso@mit.edu Cc: From: Date: Sun, 06 Jan 2019 11:40:20 +0100 Message-ID: <154677122043188@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.4-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;