From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ABE81387369; Sat, 12 Sep 2026 19:56:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789243002; cv=none; b=icE7zKEM35pp80qQ5ZU5uq6oFRFfmQ77b0WEaL6pZtPOZ4m3TddZIe0WMKWjutng1kCTt98Y1jXO6n996k3vWLeSfr6oXOeKmuK9bDAScbT97Fqep3qSVUxku8NJtqEunF8lv/29oRkG44+LPqlig23aPg1qo02QZZkBtU8qUK0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789243002; c=relaxed/simple; bh=oiH9qoAGsj2BfbX2M9BnGTvCd0mjlXaZMFpEn+3+y7Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tBgvPvw485zoKjiQqCmM8bOYjtwG8H7MlXhyIEC70Lq5CuVxgsvszPsSkH7VoAgy0/HitFddjSLDGwH4tTd/BdpamjVU0z9ylx11l93Sp4WUKwN9e4D0Qa/lAeinBPoS7eiiGO7E5EXIYaoz+vJjxe3pwl8+hlz9nkqXZyALJIQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=JlrM9xRq; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="JlrM9xRq" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1692D1F000FF; Sat, 12 Sep 2026 19:56:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789243001; bh=eiSjM6urQP6S22elEpQoov3LxcMD1lDuiKYP28Emeqw=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=JlrM9xRq3YNM2gaLvGZGuA388FHtQrF2ynW6Pb7EHqQfF4RW2U4jrqtJNCH1i1iM1 p8eft+u7TJEXeUxiGWVv/74FvZImNQXXVpMGOZQKrGCrwNHsOXKIEVcWglLaKvA5aw /47u/fmpVT/kRKe0ZgOlUa4cvss6bp0hsxPdxjkE= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Yichong Chen , OGAWA Hirofumi , Christian Brauner , Amit Sahrawat , Namjae Jeon , Ravishankar N , Andrew Morton , Sasha Levin Subject: [PATCH 5.10 600/798] fat: release buffer head after rebuilding parent Date: Sat, 12 Sep 2026 09:03:48 +0200 Message-ID: <20260912065530.877613838@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260912065516.948645775@linuxfoundation.org> References: <20260912065516.948645775@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Yichong Chen [ Upstream commit 83e98dbf19ab64e8528e101e20f8d50e1aaa68a8 ] fat_scan_logstart() leaves the matching directory entry's buffer head in sinfo.bh for the caller to release, just like fat_scan(). fat_rebuild_parent() uses the directory entry to rebuild the parent inode for the nostale_ro NFS export path, but does not release sinfo.bh after a successful scan. Release it once fat_build_inode() has consumed the directory entry data. Link: https://lore.kernel.org/20260715020957.1096309-1-chenyichong@uniontech.com Fixes: f1e6fb0ab451 ("fat (exportfs): rebuild directory-inode if fat_dget()") Signed-off-by: Yichong Chen Acked-by: OGAWA Hirofumi Cc: Christian Brauner Cc: Amit Sahrawat Cc: chenyichong Cc: Namjae Jeon Cc: Ravishankar N Signed-off-by: Andrew Morton Signed-off-by: Sasha Levin --- fs/fat/nfs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/fat/nfs.c b/fs/fat/nfs.c index bab63eeaf9cbc..bb5f056a639a2 100644 --- a/fs/fat/nfs.c +++ b/fs/fat/nfs.c @@ -250,8 +250,10 @@ struct inode *fat_rebuild_parent(struct super_block *sb, int parent_logstart) MSDOS_I(dummy_grand_parent)->i_pos = -1; } - if (!fat_scan_logstart(dummy_grand_parent, clus_to_match, &sinfo)) + if (!fat_scan_logstart(dummy_grand_parent, clus_to_match, &sinfo)) { parent = fat_build_inode(sb, sinfo.de, sinfo.i_pos); + brelse(sinfo.bh); + } brelse(parent_bh); iput(dummy_grand_parent); -- 2.53.0