Whamcloud - gitweb
LU-9841 lov: do not split IO for single striped file 60/28760/2
authorJinshan Xiong <jinshan.xiong@intel.com>
Wed, 9 Aug 2017 23:31:17 +0000 (16:31 -0700)
committerJohn L. Hammond <john.hammond@intel.com>
Thu, 14 Sep 2017 20:06:47 +0000 (20:06 +0000)
stripe size for single striped file is not reliable, it shouldn't
be used to split I/O.

Lustre-change: https://review.whamcloud.com/28451
Lustre-commit: 078a099d26ef7f5d26131c0e18615855a39f341d

Signed-off-by: Jinshan Xiong <jinshan.xiong@intel.com>
Change-Id: I47c31d59b46b07d4a6760b8985e1c19da4765a5c
Reviewed-by: Bobi Jam <bobijam@hotmail.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Signed-off-by: Minh Diep <minh.diep@intel.com>
Reviewed-on: https://review.whamcloud.com/28760
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: John L. Hammond <john.hammond@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;
-       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,