page = read_cache_page(mapping, block, (filler_t *)mapping->a_ops->readpage, NULL);
if (IS_ERR(page))
goto fail;
+ if (PageError(page)) {
+ page_cache_release(page);
+ goto fail;
+ }
#if !REF_PAGES
page_cache_release(page);
#endif
hfs_bnode_get(node);
spin_unlock(&tree->hash_lock);
wait_event(node->lock_wq, !test_bit(HFS_BNODE_NEW, &node->flags));
+ if (test_bit(HFS_BNODE_ERROR, &node->flags))
+ goto node_error;
return node;
}
spin_unlock(&tree->hash_lock);
node = __hfs_bnode_create(tree, num);
if (!node)
return ERR_PTR(-ENOMEM);
+ if (test_bit(HFS_BNODE_ERROR, &node->flags))
+ goto node_error;
if (!test_bit(HFS_BNODE_NEW, &node->flags))
return node;
node = __hfs_bnode_create(tree, num);
if (!node)
return ERR_PTR(-ENOMEM);
+ if (test_bit(HFS_BNODE_ERROR, &node->flags)) {
+ hfs_bnode_put(node);
+ return ERR_PTR(-EIO);
+ }
pagep = node->page;
memset(kmap(*pagep) + node->page_offset, 0,
}
}
-void hfsplus_lock_bnode(struct hfs_bnode *node)
-{
- wait_event(node->lock_wq, !test_and_set_bit(HFS_BNODE_LOCK, &node->flags));
-}
-
-void hfsplus_unlock_bnode(struct hfs_bnode *node)
-{
- clear_bit(HFS_BNODE_LOCK, &node->flags);
- if (waitqueue_active(&node->lock_wq))
- wake_up(&node->lock_wq);
-}