[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 6ad1211..a096c5a 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 267872e..8868d3b 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]);