From 078a099d26ef7f5d26131c0e18615855a39f341d Mon Sep 17 00:00:00 2001 From: Jinshan Xiong Date: Wed, 9 Aug 2017 16:31:17 -0700 Subject: [PATCH] LU-9841 lov: do not split IO for single striped file stripe size for single striped file is not reliable, it shouldn't be used to split I/O. Signed-off-by: Jinshan Xiong Change-Id: I47c31d59b46b07d4a6760b8985e1c19da4765a5c Reviewed-on: https://review.whamcloud.com/28451 Tested-by: Jenkins Reviewed-by: Bobi Jam Reviewed-by: Dmitry Eremin Tested-by: Maloo Reviewed-by: Oleg Drokin --- lustre/lov/lov_io.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/lustre/lov/lov_io.c b/lustre/lov/lov_io.c index 2339ea5..f40dfa2 100644 --- a/lustre/lov/lov_io.c +++ b/lustre/lov/lov_io.c @@ -485,7 +485,6 @@ static int lov_io_rw_iter_init(const struct lu_env *env, struct cl_io_range *range = &io->u.ci_rw.rw_range; loff_t start = range->cir_pos; loff_t next; - unsigned long ssize; int index; LASSERT(io->ci_type == CIT_READ || io->ci_type == CIT_WRITE); @@ -511,11 +510,15 @@ static int lov_io_rw_iter_init(const struct lu_env *env, lse = lov_lse(lio->lis_object, index); - ssize = lse->lsme_stripe_size; - lov_do_div64(start, ssize); - next = (start + 1) * ssize; - if (next <= start * ssize) - next = ~0ull; + next = MAX_LFS_FILESIZE; + if (lse->lsme_stripe_count > 1) { + unsigned long ssize = lse->lsme_stripe_size; + + lov_do_div64(start, ssize); + next = (start + 1) * ssize; + if (next <= start * ssize) + next = MAX_LFS_FILESIZE; + } LASSERTF(range->cir_pos >= lse->lsme_extent.e_start, "pos %lld, [%lld, %lld)\n", range->cir_pos, -- 1.8.3.1