[lustre-devel] [PATCH] Staging: lustre: lov: check return value of lov_sub_get()
Jinshan Xiong
jinshan.xiong at intel.com
Thu Oct 20 16:33:52 PDT 2016
Check return value of lov_sub_get() in lov_io_read_ahead().
Signed-off-by: Jinshan Xiong <jinshan.xiong at intel.com>
---
drivers/staging/lustre/lustre/lov/lov_io.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/staging/lustre/lustre/lov/lov_io.c b/drivers/staging/lustre/lustre/lov/lov_io.c
index a1d1ec9..011ab0f 100644
--- a/drivers/staging/lustre/lustre/lov/lov_io.c
+++ b/drivers/staging/lustre/lustre/lov/lov_io.c
@@ -606,6 +606,8 @@ static int lov_io_read_ahead(const struct lu_env *env,
return -EIO;
sub = lov_sub_get(env, lio, stripe);
+ if (IS_ERR(sub))
+ return PTR_ERR(sub);
lov_stripe_offset(loo->lo_lsm, cl_offset(obj, start), stripe, &suboff);
rc = cl_io_read_ahead(sub->sub_env, sub->sub_io,
--
2.8.3
More information about the lustre-devel
mailing list