summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYichong Chen <chenyichong@uniontech.com>2026-07-15 10:09:57 +0800
committerAndrew Morton <akpm@linux-foundation.org>2026-08-03 21:10:17 -0700
commit83e98dbf19ab64e8528e101e20f8d50e1aaa68a8 (patch)
tree92b7f0c6d009d31bb0ada71368016aa1f0c18612
parent10dab13117fa8a2a47a40804c8b173163a1a3129 (diff)
fat: release buffer head after rebuilding parent
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 <chenyichong@uniontech.com> Acked-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> Cc: Christian Brauner <brauner@kernel.org> Cc: Amit Sahrawat <a.sahrawat@samsung.com> Cc: chenyichong <chenyichong@uniontech.com> Cc: Namjae Jeon <namjae.jeon@samsung.com> Cc: Ravishankar N <ravi.n1@samsung.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
-rw-r--r--fs/fat/nfs.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/fat/nfs.c b/fs/fat/nfs.c
index 509eea96a457..6e1b371711ed 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);