all: correct error code EIO

The error code -EIO should always refer to a problem of
lower storage laysers. Thus MARS should not generate that
code itself, but other ones.
This commit is contained in:
Thomas Schoebel-Theuer 2015-01-15 18:21:29 +01:00 committed by Thomas Schoebel-Theuer
parent 802cc73b49
commit e7464b3c02
6 changed files with 8 additions and 8 deletions

View File

@ -467,7 +467,7 @@ restart:
GENERIC_INPUT_CALL(logst->input, mref_io, mref);
wait_event_interruptible_timeout(logst->event, logst->got, 60 * HZ);
status = -EIO;
status = -ETIME;
if (!logst->got)
goto done_put;
status = logst->error_code;

View File

@ -209,7 +209,7 @@ int make_bio(struct bio_brick *brick, void *data, int len, loff_t pos, struct bi
if (unlikely(rest_len != 0)) {
MARS_ERR("computation of bvec_count %d was wrong, diff=%d\n", bvec_count, rest_len);
status = -EIO;
status = -EINVAL;
goto out;
}

View File

@ -173,7 +173,7 @@ static int client_get_info(struct client_output *output, struct mars_info *info)
wake_up_interruptible(&output->event);
wait_event_interruptible_timeout(output->info_event, output->got_info, 60 * HZ);
status = -EIO;
status = -ETIME;
if (output->got_info && info) {
memcpy(info, &output->info, sizeof(*info));
status = 0;

View File

@ -202,7 +202,7 @@ int write_aops(struct sio_output *output, struct mref_object *mref)
if (ret) {
MARS_ERR("cannot start pagecache_write_begin() error=%d\n", ret);
if (ret >= 0)
ret = -EIO;
ret = -EINVAL;
goto fail;
}
@ -221,7 +221,7 @@ int write_aops(struct sio_output *output, struct mref_object *mref)
if (ret < 0 || ret != copied || transfer_result) {
MARS_ERR("write error %d\n", ret);
if (ret >= 0)
ret = -EIO;
ret = -EINVAL;
goto fail;
}
@ -288,7 +288,7 @@ int read_aops(struct sio_output *output, struct mref_object *mref)
{
loff_t pos = mref->ref_pos;
int len = mref->ref_len;
int ret = -EIO;
int ret;
#ifdef USE_VFS_READ
mm_segment_t oldfs;

View File

@ -1072,7 +1072,7 @@ static
int _update_link_when_necessary(struct mars_rotate *rot, const char *type, const char *old, const char *new)
{
char *check = NULL;
int status = -EIO;
int status = -EINVAL;
bool res = false;
if (unlikely(!old || !new))

View File

@ -1423,7 +1423,7 @@ int mars_kill_brick(struct mars_brick *brick)
status = 0;
} else {
MARS_ERR("brick '%s' '%s' is not off\n", SAFE_STR(brick->brick_name), SAFE_STR(brick->brick_path));
status = -EIO;
status = -EUCLEAN;
}
done: