summaryrefslogtreecommitdiffstats
path: root/drivers/staging/lustre/lustre/lov/lov_io.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/lustre/lustre/lov/lov_io.c')
-rw-r--r--drivers/staging/lustre/lustre/lov/lov_io.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/drivers/staging/lustre/lustre/lov/lov_io.c b/drivers/staging/lustre/lustre/lov/lov_io.c
index e0f0756..df77b25 100644
--- a/drivers/staging/lustre/lustre/lov/lov_io.c
+++ b/drivers/staging/lustre/lustre/lov/lov_io.c
@@ -424,21 +424,23 @@ static int lov_io_iter_init(const struct lu_env *env,
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,
- start, end);
- rc = cl_io_iter_init(sub->sub_env, sub->sub_io);
- lov_sub_put(sub);
- CDEBUG(D_VFSTRACE, "shrink: %d [%llu, %llu)\n",
- stripe, start, end);
- } else {
+ if (IS_ERR(sub)) {
rc = PTR_ERR(sub);
+ break;
}
- if (!rc)
- list_add_tail(&sub->sub_linkage, &lio->lis_active);
- else
+ lov_io_sub_inherit(sub->sub_io, lio, stripe, start, end);
+ rc = cl_io_iter_init(sub->sub_env, sub->sub_io);
+ if (rc)
+ cl_io_iter_fini(sub->sub_env, sub->sub_io);
+ lov_sub_put(sub);
+ if (rc)
break;
+
+ CDEBUG(D_VFSTRACE, "shrink: %d [%llu, %llu)\n",
+ stripe, start, end);
+
+ list_add_tail(&sub->sub_linkage, &lio->lis_active);
}
return rc;
}
OpenPOWER on IntegriCloud