Whamcloud - gitweb
LU-14337 lov: return valid stripe_count/size for PFL files 03/41803/6
authorEmoly Liu <emoly@whamcloud.com>
Tue, 16 Mar 2021 03:04:46 +0000 (11:04 +0800)
committerOleg Drokin <green@whamcloud.com>
Tue, 30 Mar 2021 04:16:13 +0000 (04:16 +0000)
commitabf04e7ea356e8b1523e4183d5c46c0462f1f605
tree02e08d72bd7f8bf91225c6b197ed679286e0b3dd
parentd123c47a18adbf5665ed63d99c53117b84db9ec8
LU-14337 lov: return valid stripe_count/size for PFL files

Dump struct lov_comp_md_v1 in function ll_lov_getstripe_ea_info()
correctly to avoid stripe_count=0 or stripe_size=0 returned by
old interface llapi_file_get_stripe(), which will cause
divide-by-zero for older userspace that calls this ioctl,
e.g. lustre ADIO driver.
The rule is:
- if stripe_count=0, return stripe_count=1;
- if stripe_size=0,
  -- for DoM files, return the stripe size of the second component,
     since the first component of DoM file data is placed on the
     MDT for faster access;
  -- else, return the stripe size of the last component.

Also, lov_getstripe_old.c and santy-pfl.sh test_25 is added to
verify this patch.

Test-parameters: testlist=sanity-pfl env=ONLY=25

Signed-off-by: Emoly Liu <emoly@whamcloud.com>
Change-Id: I4023ca4baff1b1ad2a439aa497baaabc56e891d2
Reviewed-on: https://review.whamcloud.com/41803
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Bobi Jam <bobijam@hotmail.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/llite/file.c
lustre/lov/lov_pack.c
lustre/tests/Makefile.am
lustre/tests/lov_getstripe_old.c [new file with mode: 0644]
lustre/tests/sanity-pfl.sh