If we had to return a sibling of the found block, we weren't
getting an IOLock on it, which is bad.
ib2 = iblock_get(inode, iaddr, ib->depth-1, iphys, REF);
if (!ib2) {
+ /* if iphys==0, then we were expecting to find a
+ * cached index block. If we didn't, something is
+ * wrong.
+ */
+ BUG_ON(iphys==0);
err = -ENOMEM;
lafs_iounlock_block(&ib->b);
goto err;
}
getref_locked(nxt, REF);
spin_unlock(&inode->i_data.private_lock);
+ lafs_iolock_block(nxt);
+ lafs_iounlock_block(&ib2->b);
putiref(ib2, REF);
ib2 = iblk(nxt);
spin_lock(&inode->i_data.private_lock);