err = -EBUSY; /* Try again after the checkpoint */
goto out2;
}
- /* FIXME I need some sort of lock to safely walk
- * down this list */
- ib2 = ib;
lastaddr = (i_size_read(ino) +
fs->blocksize - 1)
>> fs->blocksize_bits;
* If there are none, descend the last block that
* is not after EOF and look at its children.
*/
- next = ib;
+ ib2 = next = ib;
+ spin_lock(&ib->b.inode->i_data.private_lock);
while (next) {
ib2 = next;
next = NULL;
}
if (ib2->b.fileaddr < lastaddr) {
/* Must be all done */
+ spin_unlock(&ib->b.inode->i_data.private_lock);
clear_bit(I_Trunc, &LAFSI(ino)->iflags);
if (!test_bit(I_Deleting, &LAFSI(ino)->iflags))
iput(ino);
goto out2;
}
getiref(ib2, MKREF(inode_handle_orphan2));
+ spin_unlock(&ib->b.inode->i_data.private_lock);
/* ib2 is an index block beyond EOF with no
* Pinned children.