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=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,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 CD1BDC2D0C0 for ; Mon, 23 Dec 2019 17:15:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A2EB420663 for ; Mon, 23 Dec 2019 17:15:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577121303; bh=uhX3HKWL9lThiDL/Qk2LRSU5bDoJUo77Q+dlrqNPZn4=; h=Subject:To:Cc:From:Date:List-ID:From; b=uGzuRJl2rOhKSIcRnmrHgotyeHm0bV4JroOa27eyAMI9urfmpRnppndJLHpgdWM6P ktLgHV1LE6P8ywxWrlpMp3bjqOuCRJd/24vLFS7MJCAhG2WolVistkVjyAr80gQgPm 73S1l0VSBbpoK7dAD2iNBGOTrcCtp6MDEC/WcNEo= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726756AbfLWRPD (ORCPT ); Mon, 23 Dec 2019 12:15:03 -0500 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:39261 "EHLO out2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726718AbfLWRPD (ORCPT ); Mon, 23 Dec 2019 12:15:03 -0500 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 02927217FC; Mon, 23 Dec 2019 12:15:02 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Mon, 23 Dec 2019 12:15:02 -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=KgAAab nhl0aGAnGFD1vMSXn4Gqz6AFNWKpEB9M1zLJc=; b=Qu8GlQ5qWkYGygEEKOlJQa ODVQSsr/kslVpO46PXA7JSncEVNYmkfmWkmbaEvOx3zQ2QIyJij9er0NI7Any/DJ 3esv9KgZqMbSg0CAijkZb/3BBO/vfj+7eucQC+DOLLMB6WitDJUObMTi5Fkzt5RH qmvDEUyoeSZR5IUTykdBtJLnVLAg36/GkOxczXkF9cZm9ACe8Dbe/0w7ZFBeEPtU DUeT4vn4TV3TXEk0uLq4NmI4gK5cishUym7ZL1OwvD2eSRBEKDUsasFWLsBOOggr ci0Ve/TkFNH+oX8sN+ul61z/sjMqXvNkX3uUtidb7YO/Xaa/KFwqGyXybmsm8ZhQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrvddvtddgleejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefuvffhfffkgggtgfesthekredttd dtlfenucfhrhhomhepoehgrhgvghhkhheslhhinhhugihfohhunhgurghtihhonhdrohhr gheqnecukfhppeduleekrdekledrieegrddvgeelnecurfgrrhgrmhepmhgrihhlfhhroh hmpehgrhgvgheskhhrohgrhhdrtghomhenucevlhhushhtvghrufhiiigvpeej X-ME-Proxy: Received: from localhost (unknown [198.89.64.249]) by mail.messagingengine.com (Postfix) with ESMTPA id 52AD580062; Mon, 23 Dec 2019 12:15:01 -0500 (EST) Subject: FAILED: patch "[PATCH] btrfs: abort transaction after failed inode updates in" failed to apply to 4.14-stable tree To: josef@toxicpanda.com, dsterba@suse.com, fdmanana@suse.com, jthumshirn@suse.de Cc: From: Date: Mon, 23 Dec 2019 12:14:58 -0500 Message-ID: <15771212987252@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 c7e54b5102bf3614cadb9ca32d7be73bad6cecf0 Mon Sep 17 00:00:00 2001 From: Josef Bacik Date: Fri, 6 Dec 2019 09:37:15 -0500 Subject: [PATCH] btrfs: abort transaction after failed inode updates in create_subvol We can just abort the transaction here, and in fact do that for every other failure in this function except these two cases. CC: stable@vger.kernel.org # 4.4+ Reviewed-by: Filipe Manana Reviewed-by: Johannes Thumshirn Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 3418decb9e61..18e328ce4b54 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -704,11 +704,17 @@ static noinline int create_subvol(struct inode *dir, btrfs_i_size_write(BTRFS_I(dir), dir->i_size + namelen * 2); ret = btrfs_update_inode(trans, root, dir); - BUG_ON(ret); + if (ret) { + btrfs_abort_transaction(trans, ret); + goto fail; + } ret = btrfs_add_root_ref(trans, objectid, root->root_key.objectid, btrfs_ino(BTRFS_I(dir)), index, name, namelen); - BUG_ON(ret); + if (ret) { + btrfs_abort_transaction(trans, ret); + goto fail; + } ret = btrfs_uuid_tree_add(trans, root_item->uuid, BTRFS_UUID_KEY_SUBVOL, objectid);