[PATCH] hfs: don't reference missing page
authorRoman Zippel <zippel@linux-m68k.org>
Tue, 2 Aug 2005 04:11:41 +0000 (21:11 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Tue, 2 Aug 2005 04:38:00 +0000 (21:38 -0700)
If there was a read error, the bnode might miss some pages, so skip them.

Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
fs/hfs/bnode.c
fs/hfsplus/bnode.c

index 6ad1211f84edb0fcd4264faea1ecedb01fead7b9..a096c5a5666442530eeb208baa4069122511c11d 100644 (file)
@@ -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]);
index 267872e84d714dcf23bc4419fcbb1a5c7b8efeac..8868d3b766fd46e1c263dfdde6d1688cc1f5cd09 100644 (file)
@@ -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]);