if (!test_and_set_bit(B_ICredit, &lai->dblock->b.flags))
credits--;
lafs_space_return(fs, credits);
- /* FIXME do I need to get a SegRef ?? */
+ LAFS_BUG(!test_bit(B_SegRef, &lai->dblock->b.flags), &lai->dblock->b);
set_bit(B_PinPending, &lai->dblock->b.flags);
if (test_bit(B_Pinned, &b->flags))
lafs_pin_block_ph(&lai->dblock->b, !!test_bit(B_Phase1, &b->flags));
BUG_ON(test_bit(B_Root, &b->flags));
- if (b->physaddr == 0) {
- set_bit(B_SegRef, &b->flags);
- break;
- }
-
b2 = b;
/* Need to check parents */
ino = b->inode;
* If it cannot, then we don't need the lock.
*/
+ if (b2->physaddr == 0) {
+ /* There is no segsum to reference */
+ set_bit(B_SegRef, &b2->flags);
+ continue;
+ }
+
ss = segsum_byaddr(fs, b2->physaddr, ssnum);
if (IS_ERR(ss)) {
putref(b, MKREF(segref));