Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp889164pxb; Wed, 6 Apr 2022 03:20:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxMd4p4HNEcZ6kW0KwMuWBZkJ37tknUscvy7aZCnhLoLNOh87cKG0yREHIiX06s32NpD1D6 X-Received: by 2002:a17:90b:1652:b0:1c7:305f:3a32 with SMTP id il18-20020a17090b165200b001c7305f3a32mr8903013pjb.108.1649240411072; Wed, 06 Apr 2022 03:20:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649240411; cv=none; d=google.com; s=arc-20160816; b=eXGbY8MKk6cnyWDNdM3OScXm09WALWyynN0cSEIIeLTdPpSFZJ+fi35fNuR6m0fcPd NxM7AXFppjgG3ndyYN/NepcEK8x+KHZkLX9FHh4Tz5VMHOQBZ/jWAs77XsW/8ZdX3oaE TOVSSfHvtI4jVxCP74tAulqG+AL1M1yHXH7ARFF2FwdQBXfKDV7A/LLlNve6JCmNbsGs MR9HkxGklml1qAC0fM83f/ajs+KhTFAdZCSu5dC9HKzTdsdccZ5Nt+Js11uu7TGaouaS xe5chJfkXwzJrG3usBQsTbx4jo2Xev4Oj8wW8LvPbjDoJHuUKbSDaerI0Yl/6DxymMZW NS1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=/ZADFWGaJnBhouxpqojCJLAxDj9tPU4Tcla55TyCNho=; b=ES2X1tN+b8bS4XR+KliTMhU1fMeaqVXZ6d19Z1HioFcvk8HOfilBVOtPinofw0sd7a RfSx5rb4YAyZgQ8Ti4JuUr4fZ5rtGYz45qMkPWOHJvbwYr0WkgQPPKIhAQBMAI0EgUYy zKABTyHFD9vLMetma3WcjNagsOTGLZsKlt156jewmEyjW9YFXU5SVKy7p0+z3Fdmj6PR mJRXPJ7FSRuYdiaPP3uaxVE3sTFJr3k9GetDRPDDbEVwGkh/ggucsEC1TIsparqr23Lb G8usvY8I0fFPMiC0nwUqotwNzB4tWXuZI+Wuj0B+Md/MJP9iomnPLl72eN/fzngA1liu tWZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=XJyhMph3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id pc2-20020a17090b3b8200b001c97d373310si5112540pjb.102.2022.04.06.03.20.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 03:20:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=XJyhMph3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2B4CE1D2046; Wed, 6 Apr 2022 01:43:39 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1579527AbiDEXbl (ORCPT + 99 others); Tue, 5 Apr 2022 19:31:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344820AbiDEKkN (ORCPT ); Tue, 5 Apr 2022 06:40:13 -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 DEFB12CCA1; Tue, 5 Apr 2022 03:25:27 -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 9DCE7B81C99; Tue, 5 Apr 2022 10:25:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EAB16C385A0; Tue, 5 Apr 2022 10:25:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649154325; bh=PosF61ntB1uijio+vV8tUqN3VMsMmYWTHjqTxsw4wLs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XJyhMph3d9a65XHUPN3hZOPyWxY3e9mQLmndQrQhrB3HaYxaW6RhViKSH9/bhWgTl 1oyuQtixHa1ENG56PiJhnWNFQHxG3Zu4yy60BBFxrJUJIWCrvu6+1/kN9r7XSecFKJ PUPHBdXmuztPj1VaOP9/PfPbpbKouQILsA6uXfBM= 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 5.10 540/599] ubifs: Add missing iput if do_tmpfile() failed in rename whiteout Date: Tue, 5 Apr 2022 09:33:54 +0200 Message-Id: <20220405070314.911715436@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070258.802373272@linuxfoundation.org> References: <20220405070258.802373272@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 @@ -431,6 +431,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)