From: Roman Zippel Date: Tue, 2 Aug 2005 04:11:41 +0000 (-0700) Subject: [PATCH] hfs: don't reference missing page X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=74f9c9c258249fba3e2e78f70691528426a6c010;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git [PATCH] hfs: don't reference missing page If there was a read error, the bnode might miss some pages, so skip them. Signed-off-by: Roman Zippel Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/hfs/bnode.c b/fs/hfs/bnode.c index 6ad1211f84e..a096c5a5666 100644 --- a/fs/hfs/bnode.c +++ b/fs/hfs/bnode.c @@ -480,6 +480,8 @@ void hfs_bnode_put(struct hfs_bnode *node) return; } for (i = 0; i < tree->pages_per_bnode; i++) { + if (!node->page[i]) + continue; mark_page_accessed(node->page[i]); #if REF_PAGES put_page(node->page[i]); diff --git a/fs/hfsplus/bnode.c b/fs/hfsplus/bnode.c index 267872e84d7..8868d3b766f 100644 --- a/fs/hfsplus/bnode.c +++ b/fs/hfsplus/bnode.c @@ -643,6 +643,8 @@ void hfs_bnode_put(struct hfs_bnode *node) return; } for (i = 0; i < tree->pages_per_bnode; i++) { + if (!node->page[i]) + continue; mark_page_accessed(node->page[i]); #if REF_PAGES put_page(node->page[i]);