Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp7704425rwn; Wed, 14 Sep 2022 03:11:58 -0700 (PDT) X-Google-Smtp-Source: AA6agR5GbjDLvjbz0EqIKHJzsGRqnYHdc4idMTJDLgUZCjpSfct+YWWzSi8vS28BgKR1VRvC8Tpm X-Received: by 2002:a63:e52:0:b0:438:ebec:363e with SMTP id 18-20020a630e52000000b00438ebec363emr13257424pgo.437.1663150317932; Wed, 14 Sep 2022 03:11:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663150317; cv=none; d=google.com; s=arc-20160816; b=nQaoc9pEmgnCm8LokGuh1ULXyJ/1SzkehzvWozKP9VA1BPjwgGUatExY1I7NFCVRDW KtInF5tNBVcvGajztk9VwZJyE7F/cFO8PDrRVo7D8dsVNYUibxw3VM80yzHNxXOSws24 RwaRoiei5IR0JHcvZVMLQPHqYdNQqbDkQiWGpufOZfxNn0yw2cCgtyqdHwvQ93XoWO6n vaExSrBhv0VMOw0gGKkI2G1XGbh1PfRNnxcEsnY2iJ9A5mwacgjPKpdUWCrvh7WUu+3q OUmOBdBuRVK0QK1eRH5ZfL2HSxyILU0NEnqqwXyIgfzVAL1ztdX5hOgQScrj2GyOrohs tkQw== 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 :message-id:date:subject:cc:to:from; bh=zUACd4HrdK5s84IPbbucZYR3C2X7v4m24NwvxdrGyXU=; b=u1vm/M8slfmTI+g4xTLgLHyRkY4mn0vsgm68xI2sBzzQXF5XLsmO5WBC39WSFdgvNn Otd1R0SJUsE8ttRtYysEIyddETzOW1P9V1TCqilKdl/rK7lD4oO9gy772+cv5vkTYIhV i5+ukRxYFZzMLFE1Zd/5Mzcy32QBvhnvzL73+nDuU9l1NzFQo0yNo38+L5W3Bb8vNnsB AZqQatykY9TKCR69sMQEwTQe405Spl/EhEz5tMx6cx6wWueRaOZvTS/PoF6OJUxc+zq/ +cZ8D3Ik1fOruS2Fu5vcQYlzxUBOTYq2WhRdLIf+kv6E7XjhX1tYAcXrL8b+5MmFLRwb jL2w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d1-20020a655ac1000000b00434df8032e4si15279850pgt.139.2022.09.14.03.11.40; Wed, 14 Sep 2022 03:11:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230501AbiINJ60 (ORCPT + 99 others); Wed, 14 Sep 2022 05:58:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231131AbiINJ6U (ORCPT ); Wed, 14 Sep 2022 05:58:20 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8D6C4D162; Wed, 14 Sep 2022 02:58:02 -0700 (PDT) Received: from canpemm500010.china.huawei.com (unknown [172.30.72.57]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4MSFzH2Zhmz14QR2; Wed, 14 Sep 2022 17:54:03 +0800 (CST) Received: from huawei.com (10.175.127.227) by canpemm500010.china.huawei.com (7.192.105.118) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Wed, 14 Sep 2022 17:58:00 +0800 From: Ye Bin To: , , CC: , , Ye Bin Subject: [PATCH -next] ext4: fix miss release buffer head in ext4_fc_write_inode Date: Wed, 14 Sep 2022 18:08:59 +0800 Message-ID: <20220914100859.1415196-1-yebin10@huawei.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.127.227] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To canpemm500010.china.huawei.com (7.192.105.118) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 In 'ext4_fc_write_inode' function first call 'ext4_get_inode_loc' get 'iloc', after use it miss release 'iloc.bh'. So just release 'iloc.bh' before 'ext4_fc_write_inode' return. Signed-off-by: Ye Bin --- fs/ext4/fast_commit.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/fs/ext4/fast_commit.c b/fs/ext4/fast_commit.c index 2af962cbb835..b7414a5812f6 100644 --- a/fs/ext4/fast_commit.c +++ b/fs/ext4/fast_commit.c @@ -874,22 +874,25 @@ static int ext4_fc_write_inode(struct inode *inode, u32 *crc) tl.fc_tag = cpu_to_le16(EXT4_FC_TAG_INODE); tl.fc_len = cpu_to_le16(inode_len + sizeof(fc_inode.fc_ino)); + ret = -ECANCELED; dst = ext4_fc_reserve_space(inode->i_sb, sizeof(tl) + inode_len + sizeof(fc_inode.fc_ino), crc); if (!dst) - return -ECANCELED; + goto err; if (!ext4_fc_memcpy(inode->i_sb, dst, &tl, sizeof(tl), crc)) - return -ECANCELED; + goto err; dst += sizeof(tl); if (!ext4_fc_memcpy(inode->i_sb, dst, &fc_inode, sizeof(fc_inode), crc)) - return -ECANCELED; + goto err; dst += sizeof(fc_inode); if (!ext4_fc_memcpy(inode->i_sb, dst, (u8 *)ext4_raw_inode(&iloc), inode_len, crc)) - return -ECANCELED; - - return 0; + goto err; + ret = 0; +err: + brelse(iloc.bh); + return ret; } /* -- 2.31.1