]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - fs/hfs/bnode.c
hfs: avoid crash in hfs_bnode_create
[karo-tx-linux.git] / fs / hfs / bnode.c
index f3b1a15ccd5930e72896bdbaf3213460c3bb9f34..d3fa6bd9503e762c861debdd4fe64bef546bb78f 100644 (file)
@@ -415,7 +415,11 @@ struct hfs_bnode *hfs_bnode_create(struct hfs_btree *tree, u32 num)
        spin_lock(&tree->hash_lock);
        node = hfs_bnode_findhash(tree, num);
        spin_unlock(&tree->hash_lock);
-       BUG_ON(node);
+       if (node) {
+               pr_crit("new node %u already hashed?\n", num);
+               WARN_ON(1);
+               return node;
+       }
        node = __hfs_bnode_create(tree, num);
        if (!node)
                return ERR_PTR(-ENOMEM);