Whamcloud - gitweb
LU-14337 lov: return valid stripe_count/size for PFL files
authorEmoly Liu <emoly@whamcloud.com>
Tue, 16 Mar 2021 03:04:46 +0000 (11:04 +0800)
committerAndreas Dilger <adilger@whamcloud.com>
Mon, 11 Oct 2021 05:29:41 +0000 (05:29 +0000)
commitc508c8925e6401ad52aa4e71687fa8f861a50b48
tree258a7e1a647fab8f24216cfe6764df1a363e911b
parent301469d5287fec17a9c404c27fd3805dbb96593e
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.

Lustre-change: https://review.whamcloud.com/41803
Lustre-commit: abf04e7ea356e8b1523e4183d5c46c0462f1f605

Test-Parameters: testlist=sanity-pfl env=ONLY=25
Signed-off-by: Emoly Liu <emoly@whamcloud.com>
Change-Id: I4023ca4baff1b1ad2a439aa497baaabc56e891d2
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Bobi Jam <bobijam@hotmail.com>
Reviewed-on: https://review.whamcloud.com/45028
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@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