while ((b = lafs_get_flushable(fs, oldphase)) != NULL) {
int unlock = 1;
dprintk("Checkpoint Block %s\n", strblk(b));
+ /* FIXME I should check for Async children and
+ * de-async them.
+ */
if (!test_bit(B_Pinned, &b->flags))
/* Haven't refiled since we cleared that */ ;
int __must_check
lafs_wait_block(struct block *b)
{
- if (test_bit(B_IOLock, &b->flags)) {
+ if (test_bit(B_IOLock, &b->flags) &&
+ !test_bit(B_Valid, &b->flags)) {
DEFINE_WAIT(wq);
for (;;) {
prepare_to_wait(&block_wait, &wq, TASK_UNINTERRUPTIBLE);
- if (test_bit(B_IOLock, &b->flags))
+ if (test_bit(B_IOLock, &b->flags) &&
+ !test_bit(B_Valid, &b->flags))
schedule();
else
break;
if (!test_and_set_bit(B_Async, &b->flags))
getref(b, MKREF(async));
}
- if (!test_bit(B_IOLock, &b->flags)) {
+ if (!test_bit(B_IOLock, &b->flags) ||
+ test_bit(B_Valid, &b->flags)) {
if (test_and_clear_bit(B_Async, &b->flags))
putref(b, MKREF(async));
if (test_bit(B_Valid, &b->flags))