struct inode *inode = c->ic_object;
struct iam_idle_head *head;
struct buffer_head *bh;
- int err;
+ int err = 0;
LASSERT(mutex_is_locked(&c->ic_idle_mutex));
CERROR("%.16s: cannot load idle blocks, blk = %u, err = %d\n",
LDISKFS_SB(inode->i_sb)->s_es->s_volume_name, blk, err);
c->ic_idle_failed = 1;
+ err = err ? err : -EIO;
return ERR_PTR(err);
}
*bh = ldiskfs_bread(h, c->ic_object, (int)ptr, 0, &result);
if (*bh == NULL)
- result = -EIO;
+ result = result ? result : -EIO;
return result;
}
mutex_unlock(&c->ic_idle_mutex);
bh = ldiskfs_bread(NULL, inode, *b, 0, e);
- if (bh == NULL)
+ if (bh == NULL) {
+ *e = *e ? *e : -EIO;
return NULL;
+ }
goto got;
}
iam_unlock_htree(path->ip_container, lh);
do_corr(schedule());
err = iam_txn_dirty(handle, path, new_leaf);
- brelse(new_leaf);
if (err == 0)
err = ldiskfs_mark_inode_dirty(handle, obj);
do_corr(schedule());
} else
err = -ENOMEM;
+ brelse(new_leaf);
}
assert_inv(iam_leaf_check(leaf));
assert_inv(iam_leaf_check(&iam_leaf_path(leaf)->ip_leaf));