From: Roman Zippel Date: Tue, 2 Aug 2005 04:11:41 +0000 (-0700) Subject: [PATCH] hfs: don't reference missing page X-Git-Tag: v3.12-rc1~42883 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=74f9c9c258249fba3e2e78f70691528426a6c010;p=kernel%2Fkernel-generic.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 6ad1211..a096c5a 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 267872e..8868d3b 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]);