From patchwork Thu Apr 14 13:12:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 561823 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D4F7DC4321E for ; Thu, 14 Apr 2022 13:33:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244821AbiDNNgG (ORCPT ); Thu, 14 Apr 2022 09:36:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56934 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343769AbiDNN34 (ORCPT ); Thu, 14 Apr 2022 09:29:56 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9927F972F4; Thu, 14 Apr 2022 06:25:24 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id E12D8B8296A; Thu, 14 Apr 2022 13:25:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 35915C385A1; Thu, 14 Apr 2022 13:25:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649942721; bh=/BR9E8+sZG/B87Aap9jtscIHcHWuHIUHp1dRjTx76Cg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BdLzu+PUmZS9OHLb0DQnkKvI2PtTClkAe1N1VuWfrLMCenmf090v3f5AoOx6Z5bZp 6VSaX+qY0n+VlyKke6Qr/2wdvNWujaNq6rahb5gjS4Vv6xLCjoZN+shp1L5fu/Tsmy HH1LEGMSlS7cmByrz+9TW7FgHbCUfTclSDy7xtHI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Zhihao Cheng , Sascha Hauer , Richard Weinberger Subject: [PATCH 4.19 235/338] ubifs: Add missing iput if do_tmpfile() failed in rename whiteout Date: Thu, 14 Apr 2022 15:12:18 +0200 Message-Id: <20220414110845.576594897@linuxfoundation.org> X-Mailer: git-send-email 2.35.2 In-Reply-To: <20220414110838.883074566@linuxfoundation.org> References: <20220414110838.883074566@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Zhihao Cheng commit 716b4573026bcbfa7b58ed19fe15554bac66b082 upstream. whiteout inode should be put when do_tmpfile() failed if inode has been initialized. Otherwise we will get following warning during umount: UBIFS error (ubi0:0 pid 1494): ubifs_assert_failed [ubifs]: UBIFS assert failed: c->bi.dd_growth == 0, in fs/ubifs/super.c:1930 VFS: Busy inodes after unmount of ubifs. Self-destruct in 5 seconds. Fixes: 9e0a1fff8db56ea ("ubifs: Implement RENAME_WHITEOUT") Signed-off-by: Zhihao Cheng Suggested-by: Sascha Hauer Signed-off-by: Richard Weinberger Signed-off-by: Greg Kroah-Hartman --- fs/ubifs/dir.c | 2 ++ 1 file changed, 2 insertions(+) --- a/fs/ubifs/dir.c +++ b/fs/ubifs/dir.c @@ -451,6 +451,8 @@ out_inode: make_bad_inode(inode); if (!instantiated) iput(inode); + else if (whiteout) + iput(*whiteout); out_budg: ubifs_release_budget(c, &req); if (!instantiated)