diff options
Diffstat (limited to 'drivers/staging/lustre/lustre/lov/lov_io.c')
-rw-r--r-- | drivers/staging/lustre/lustre/lov/lov_io.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/drivers/staging/lustre/lustre/lov/lov_io.c b/drivers/staging/lustre/lustre/lov/lov_io.c index f1f6db3..cf96e0d 100644 --- a/drivers/staging/lustre/lustre/lov/lov_io.c +++ b/drivers/staging/lustre/lustre/lov/lov_io.c @@ -148,6 +148,9 @@ static int lov_io_sub_init(const struct lu_env *env, struct lov_io *lio, LASSERT(sub->sub_env == NULL); LASSERT(sub->sub_stripe < lio->lis_stripe_count); + if (unlikely(lov_r0(lov)->lo_sub[stripe] == NULL)) + return -EIO; + result = 0; sub->sub_io_initialized = 0; sub->sub_borrowed = 0; @@ -391,7 +394,16 @@ static int lov_io_iter_init(const struct lu_env *env, endpos, &start, &end)) continue; - end = lov_offset_mod(end, +1); + if (unlikely(lov_r0(lio->lis_object)->lo_sub[stripe] == NULL)) { + if (ios->cis_io->ci_type == CIT_READ || + ios->cis_io->ci_type == CIT_WRITE || + ios->cis_io->ci_type == CIT_FAULT) + return -EIO; + + continue; + } + + end = lov_offset_mod(end, 1); sub = lov_sub_get(env, lio, stripe); if (!IS_ERR(sub)) { lov_io_sub_inherit(sub->sub_io, lio, stripe, @@ -913,7 +925,7 @@ int lov_io_init_empty(const struct lu_env *env, struct cl_object *obj, break; case CIT_FSYNC: case CIT_SETATTR: - result = +1; + result = 1; break; case CIT_WRITE: result = -EBADF; |