Whamcloud - gitweb
LU-9841 lov: do not split IO for single striped file 51/28451/2
authorJinshan Xiong <jinshan.xiong@intel.com>
Wed, 9 Aug 2017 23:31:17 +0000 (16:31 -0700)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 28 Aug 2017 06:25:02 +0000 (06:25 +0000)
stripe size for single striped file is not reliable, it shouldn't
be used to split I/O.

Signed-off-by: Jinshan Xiong <jinshan.xiong@intel.com>
Change-Id: I47c31d59b46b07d4a6760b8985e1c19da4765a5c
Reviewed-on: https://review.whamcloud.com/28451
Tested-by: Jenkins
Reviewed-by: Bobi Jam <bobijam@hotmail.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/lov/lov_io.c

index 2339ea5..f40dfa2 100644 (file)
@@ -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;
        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);
        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);
 
 
        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,
 
        LASSERTF(range->cir_pos >= lse->lsme_extent.e_start,
                 "pos %lld, [%lld, %lld)\n", range->cir_pos,