continue;
retval = quota_file_create(h, fs, qtype, fmt);
- if (retval < 0) {
- log_debug("Cannot initialize io on quotafile");
- continue;
+ if (retval) {
+ log_debug("Cannot initialize io on quotafile: %s",
+ error_message(retval));
+ goto out;
}
write_dquots(dict, h);
retval = quota_file_close(qctx, h);
- if (retval < 0) {
- log_err("Cannot finish IO on new quotafile: %s",
- strerror(errno));
+ if (retval) {
+ log_debug("Cannot finish IO on new quotafile: %s",
+ strerror(errno));
if (h->qh_qf.e2_file)
ext2fs_file_close(h->qh_qf.e2_file);
(void) quota_inode_truncate(fs, h->qh_qf.ino);
- continue;
+ goto out;
}
/* Set quota inode numbers in superblock. */
if (h->qh_ops->check_file &&
(h->qh_ops->check_file(h, qtype, fmt) == 0)) {
log_err("qh_ops->check_file failed");
+ err = EIO;
goto errout;
}
if (h->qh_ops->init_io && (h->qh_ops->init_io(h) < 0)) {
log_err("qh_ops->init_io failed");
+ err = EIO;
goto errout;
}
if (allocated_handle)
ext2fs_file_close(e2_file);
if (allocated_handle)
ext2fs_free_mem(&h);
- return -1;
+ return err;
}
static errcode_t quota_inode_init_new(ext2_filsys fs, ext2_ino_t ino)
{
if (h->qh_io_flags & IOFL_INFODIRTY) {
if (h->qh_ops->write_info && h->qh_ops->write_info(h) < 0)
- return -1;
+ return EIO;
h->qh_io_flags &= ~IOFL_INFODIRTY;
}
if (h->qh_ops->end_io && h->qh_ops->end_io(h) < 0)
- return -1;
+ return EIO;
if (h->qh_qf.e2_file) {
__u64 new_size, size;