Commit 5fd8f8b8 authored by Jinshan Xiong's avatar Jinshan Xiong Committed by Greg Kroah-Hartman

staging: lustre: lov: cleanup when cl_io_iter_init() fails

In lov_io_iter_init(), if cl_io_iter_init() against sub io fails,
it should call cl_io_iter_fini() to cleanup leftover information;
Signed-off-by: default avatarJinshan Xiong <jinshan.xiong@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6271
Reviewed-on: http://review.whamcloud.com/16456Reviewed-by: default avatarBobi Jam <bobijam@hotmail.com>
Reviewed-by: default avatarJohn L. Hammond <john.hammond@intel.com>
Reviewed-by: default avatarJames Simmons <uja.ornl@yahoo.com>
Reviewed-by: default avatarOleg Drokin <oleg.drokin@intel.com>
Signed-off-by: default avatarJames Simmons <jsimmons@infradead.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 719e9e08
......@@ -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);
if (IS_ERR(sub)) {
rc = PTR_ERR(sub);
break;
}
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);
} else {
rc = PTR_ERR(sub);
}
if (!rc)
list_add_tail(&sub->sub_linkage, &lio->lis_active);
else
break;
}
return rc;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment