From: Jinshan Xiong Date: Wed, 9 Aug 2017 23:31:17 +0000 (-0700) Subject: LU-9841 lov: do not split IO for single striped file X-Git-Tag: 2.10.53~68 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=078a099d26ef7f5d26131c0e18615855a39f341d 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 --- 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,