.TP
.B -S\fR, \fB--stripe-size \fR<\fIstripe_size\fR>
The number of bytes to store on each OST before moving to the next OST. \fB0\fR
-means to use the filesystem-wide default stripe_size (default 1MB).
+means to use the filesystem-wide default stripe_size (default 4MB).
.TP
.B -i\fR, \fB--stripe-index \fR<\fIstart_ost_index\fR>
The OST index (starting at 0) on which to start striping for this file. \fB-1\fR
#define LOV_DESC_MAGIC 0xB0CCDE5C
#define LOV_DESC_QOS_MAXAGE_DEFAULT 5 /* Seconds */
-#define LOV_DESC_STRIPE_SIZE_DEFAULT (1 << LNET_MTU_BITS)
+#define LOV_DESC_STRIPE_SIZE_DEFAULT (4 << LNET_MTU_BITS)
/* LOV settings descriptor (should only contain static info) */
struct lov_desc {
LOAD_MODULES_REMOTE=${LOAD_MODULES_REMOTE:-false}
-STRIPE_BYTES=${STRIPE_BYTES:-1048576}
-STRIPES_PER_OBJ=${STRIPES_PER_OBJ:-0}
+DEF_STRIPE_SIZE=${DEF_STRIPE_SIZE:-} # filesystem default stripe size in bytes
+DEF_STRIPE_COUNT=${DEF_STRIPE_COUNT:-} # filesystem default stripe count
SINGLEMDS=${SINGLEMDS:-"mds1"}
TIMEOUT=${TIMEOUT:-20}
PTLDEBUG=${PTLDEBUG:-"vfstrace rpctrace dlmtrace neterror ha config \
check_mount || error "check client $MOUNT failed"
#set xattr
- $SETSTRIPE -E 1M -c 1 -E 64M -c 1 -E -1 -c -1 $file ||
+ $SETSTRIPE -E 1M -S 1M -c 1 -E 64M -c 1 -E -1 -c -1 $file ||
error "Create file with 3 components failed"
$TRUNCATE $file $((1024*1024*64+1)) || error "truncate file failed"
i=$($GETSTRIPE -I3 -c $file) || error "get 3rd stripe count failed"
test_0g() {
local tf=$DIR/$tfile
- $LFS mirror create -N -E 1M -o0 --flags=prefer -E eof -o1 -N -o1 $tf ||
- error "create mirrored file $tf failed"
+ $LFS mirror create -N -E 1M -S 1M -o0 --flags=prefer -E eof -o1 \
+ -N -o1 $tf || error "create mirrored file $tf failed"
verify_comp_attr lcme_flags $tf 0x10001 prefer
verify_comp_attr lcme_flags $tf 0x10002 prefer
test_0h() {
local tf=$DIR/$tfile
- $LFS mirror create -N -E 1M --flags=prefer -E eof -N2 $tf ||
+ $LFS mirror create -N -E 1M -S 1M --flags=prefer -E eof -N2 $tf ||
error "create mirrored file $tf failed"
verify_comp_attr lcme_flags $tf 0x10001 prefer
local tf=$DIR/$tfile
local tf2=$DIR/$tfile-2
- $LFS setstripe -E 1M -E EOF -c 1 $tf
- $LFS setstripe -E 2M -E EOF -c -1 $tf2
+ $LFS setstripe -E 1M -S 1M -E EOF -c 1 $tf
+ $LFS setstripe -E 2M -S 1M -E EOF -c -1 $tf2
local layout=$($LFS getstripe $tf2 | grep -A 4 lmm_objects)
test_mkdir $DIR/$tdir
# set mirror with setstripe options to directory
- $LFS mirror create -N2 -E 1M -E eof $DIR/$tdir ||
+ $LFS mirror create -N2 -E 1M -S 1M -E eof $DIR/$tdir ||
error "set mirror to directory error"
[ x$($LFS getstripe -v $DIR/$tdir | awk '/lcm_flags/{print $2}') = \
test_6() {
local tf=$DIR/$tfile
- $LFS mirror create -N -E 1M -L mdt -E eof -N -E eof $tf &&
+ $LFS mirror create -N -E 1M -S 1M -L mdt -E eof -N -E eof $tf &&
error "expect failure to create mirrored file with DoM"
- $LFS mirror create -N -E 1M -E eof -N -E 1M -L mdt -E eof $tf &&
+ $LFS mirror create -N -E 1M -S 1M -E eof -N -E 1M -L mdt -E eof $tf &&
error "expect failure to create mirrored file with DoM"
- $LFS setstripe -E 1M -L mdt -E eof $tf
+ $LFS setstripe -E 1M -S 1M -L mdt -E eof $tf
$LFS mirror extend -N2 $tf &&
error "expect failure to extend mirror with DoM"
- $LFS mirror create -N2 -E 1M -E eof $tf-2
+ $LFS mirror create -N2 -E 1M -S 1M -E eof $tf-2
$LFS mirror extend -N -f $tf $tf-2 &&
error "expect failure to extend mirrored file with DoM extent"
local tf
for tf in "$@"; do
- $LFS setstripe -E 1M -E 2M -E 4M -E eof -c -1 $tf
- $LFS setstripe -E 3M -E 6M -E eof -c -1 $tf-tmp
+ $LFS setstripe -E 1M -S 1M -E 2M -E 4M -E eof -c -1 $tf
+ $LFS setstripe -E 3M -S 1M -E 6M -E eof -c -1 $tf-tmp
$LFS mirror extend -N -f $tf-tmp $tf ||
error "merging $tf-tmp into $tf failed"
shift
for tf in "$@"; do
- $LFS setstripe -E 1M -c 1 -E eof -c -1 $tf
+ $LFS setstripe -E 1M -S 1M -c 1 -E eof -c -1 $tf
dd if=/dev/urandom of=$tf bs=1M count=16 &> /dev/null
$TRUNCATE $tf $fsize
local tf=$DIR/$tfile
local ref=$DIR/${tfile}-ref
- $LFS setstripe -E 1M -c 1 -E 4M -c 2 -E eof -c -1 $tf
- $LFS setstripe -E 2M -c 1 -E 6M -c 2 -E 8M -c -1 -E eof -c -1 $tf-2
- $LFS setstripe -E 4M -c 1 -E 8M -c 2 -E eof -c -1 $tf-3
+ $LFS setstripe -E 1M -S 1M -c 1 -E 4M -c 2 -E eof -c -1 $tf ||
+ error "creating $tf failed"
+ $LFS setstripe -E 2M -S 1M -c 1 -E 6M -c 2 -E 8M -c -1 -E eof -c -1 \
+ $tf-2 || error "creating $tf-2 failed"
+ $LFS setstripe -E 4M -c 1 -E 8M -c 2 -E eof -c -1 $tf-3 ||
+ error "creating $tf-3 failed"
# instantiate all components
$LFS mirror extend -N -f $tf-2 $tf ||
for ops in "conv=notrunc" ""; do
rm -f $tf
- $LFS mirror create -N -E2m -E4m -E-1 --flags=prefer \
- -N -E1m -E2m -E4m -E-1 $tf ||
+ $LFS mirror create -N -E 2M -S 1M -E 4M -E -1 --flags=prefer \
+ -N -E 1M -E 2M -E 4M -E -1 $tf ||
error "create PFLR file $tf failed"
dd if=/dev/zero of=$tf $ops bs=1M seek=2 count=1 ||
error "write PFLR file $tf failed"
rm -f $tf $tf-1
echo " **create two FLR files $tf $tf-1"
- $LFS mirror create -N -E2m -E4m -E-1 -N -E1m -E2m -E3m -E-1 $tf ||
+ $LFS mirror create -N -E 2M -S 1M -E 4M -E -1 \
+ -N -E 1M -E 2M -E 3M -E -1 $tf ||
error "create PFLR file $tf failed"
- $LFS mirror create -N -E2m -Eeof -N -E1m -Eeof --flags prefer \
- -N -E4m -Eeof $tf-1 || error "create PFLR file $tf-1 failed"
+ $LFS mirror create -N -E 2M -S 1M -E eof \
+ -N -E 1M -E eof --flags prefer \
+ -N -E 4m -E eof $tf-1 ||
+ error "create PFLR file $tf-1 failed"
# file should be in ro status
echo " **verify files be RDONLY"
$mirror_cmd $td &> /dev/null && error "$td is not a regular file"
# create mirrored files
- $LFS mirror create -N -E 4M -E 10M -E EOF $tf ||
+ $LFS mirror create -N -E 4M -S 1M -E 10M -E EOF $tf ||
error "create mirrored file $tf failed"
- $LFS mirror create -N -E 2M -E EOF \
+ $LFS mirror create -N -E 2M -S 1M -E EOF \
-N -E 6M -E 8M -E EOF \
-N -E 16M -E EOF $tf-1 ||
error "create mirrored file $tf-1 failed"
- $LFS mirror create -N -c 2 -o 1,3 -N -S 4M -c -1 $tf-2 ||
+ $LFS mirror create -N -c 2 -o 1,3 -N -S 2M -c -1 $tf-2 ||
error "create mirrored file $tf-2 failed"
# write data in [0, 10M)
error "create remote directory failed"
rm -f $tf $tf1 $tf.mirror~2
# create file with 4 mirrors
- $LFS mirror create -N -E2m -E4m -E-1 -N -E1m -E2m -E3m -E-1 -N2 $tf ||
+ $LFS mirror create -N -E 2M -S 1M -E 4M -E -1 \
+ -N -E 1M -E 2M -E 3M -E -1 -N2 $tf ||
error "create PFLR file $tf failed"
# file should be in ro status
local tf2=$DIR2/$tfile
local tf3=$DIR3/$tfile
- $LFS setstripe -E 1M -E 2M -c 2 -E 4M -E 16M -E eof $tf
- $LFS setstripe -E 2M -E 6M -c 2 -E 8M -E 32M -E eof $tf-2
+ $LFS setstripe -E 1M -S 1M -E 2M -c 2 -E 4M -E 16M -E eof $tf
+ $LFS setstripe -E 2M -S 1M -E 6M -c 2 -E 8M -E 32M -E eof $tf-2
$LFS setstripe -E 4M -c 2 -E 8M -E 64M -E eof $tf-3
$LFS mirror extend -N -f $tf-2 $tf ||
local tf=$DIR/$tfile
local ids
- $LFS setstripe -E 1M -c 1 $tf
+ $LFS setstripe -E 1M -S 1M -c 1 $tf
ids=($($LFS getstripe $tf | awk '/lcme_id/{print $2}' | tr '\n' ' '))
verify_comp_attr stripe-count $tf ${ids[0]} 1
}
run_test 202 "lfs setstripe --add-component wide striping"
-
complete $SECONDS
check_and_cleanup_lustre
exit_status
test_1b() {
mkdir -p $DIR/$tdir
- $LFS setstripe -E 1M -E 64M -c 2 -E -1 -c 4 $DIR/$tdir ||
+ $LFS setstripe -E 1M -S 1M -E 64M -c 2 -E -1 -c 4 $DIR/$tdir ||
error "failed to set default stripe"
local f=$DIR/$tdir/$tfile
rm -f $f
#define OBD_FAIL_LFSCK_BAD_LMMOI 0x160f
do_facet $SINGLEMDS $LCTL set_param fail_loc=0x160f
createmany -o $DIR/$tdir/f 1
- $LFS setstripe -E 1M -E -1 $DIR/$tdir/f1 ||
+ $LFS setstripe -E 1M -S 1M -E -1 $DIR/$tdir/f1 ||
error "(0) Fail to create PFL $DIR/$tdir/f1"
do_facet $SINGLEMDS $LCTL set_param fail_loc=0
check_mount_and_prep
- $LFS setstripe -E 2M -c 1 -E -1 $DIR/$tdir/f0 ||
+ $LFS setstripe -E 2M -S 1M -c 1 -E -1 $DIR/$tdir/f0 ||
error "(0) Fail to create PFL $DIR/$tdir/f0"
cat $LUSTRE/tests/test-framework.sh > $DIR/$tdir/f0 ||
dd if=$comp_file of=/dev/null bs=1M count=2 > /dev/null 2>&1 ||
error "Read beyond component should short read, not fail"
- $LFS setstripe --component-add -E 2M -c 1 $comp_file ||
+ $LFS setstripe --component-add -E 2M -S 1M -c 1 $comp_file ||
error "Add component to $comp_file failed"
comp_cnt=$($LFS getstripe --component-count $comp_file)
test_mkdir $DIR/$tdir
rm -f $comp_file
- $LFS setstripe -E 1M -E 64M -c 2 -E -1 -c 3 $comp_file ||
+ $LFS setstripe -E 1M -S 1M -E 64M -c 2 -E -1 -c 3 $comp_file ||
error "Create $comp_file failed"
local comp_cnt=$($LFS getstripe --component-count $comp_file)
rm -f $comp_file || error "Delete $comp_file failed"
- $LFS setstripe -E 1M -E 16M -E -1 $comp_file ||
+ $LFS setstripe -E 1M -S 1M -E 16M -E -1 $comp_file ||
error "Create second $comp_file failed"
del_comp_and_verify $comp_file "^init" 1 0
chmod 0777 $DIR/$tdir || error "chmod $tdir failed"
local comp_file=$DIR/$tdir/$tfile
- $RUNAS $LFS setstripe -E 1M -c 1 $comp_file ||
+ $RUNAS $LFS setstripe -E 1M -S 1M -c 1 $comp_file ||
error "Create composite file $comp_file failed"
$RUNAS $LFS setstripe --component-add -E 64M -c 4 $comp_file ||
test_mkdir $DIR/$tdir
rm -f $comp_file
- $LFS setstripe -E 1m -S 1m -E 2M -c 1 $comp_file ||
+ $LFS setstripe -E 1M -S 1M -E 2M -c 1 $comp_file ||
error "Create $comp_file failed"
local comp_cnt=$($LFS getstripe --component-count $comp_file)
rm -f $comp_file
# only 1st component instantiated
- $LFS setstripe -E 1m -E 2m -E 3m -E -1 $comp_file ||
+ $LFS setstripe -E 1M -S 1M -E 2M -E 3M -E -1 $comp_file ||
error "Create $comp_file failed"
local f1=$($LFS getstripe -I1 $comp_file | grep "l_fid")
rm -f $file
# specify ost list for component
- $LFS setstripe -E1m -c2 -o0,1 -E2m -c2 -o1,2 -E3m -c2 -o2,1 \
- -E4m -c1 -i2 -E-1 $file ||
+ $LFS setstripe -E 1M -S 1M -c 2 -o 0,1 -E 2M -c 2 -o 1,2 \
+ -E 3M -c 2 -o 2,1 -E 4M -c 1 -i 2 -E -1 $file ||
error "Create $file failed"
# clear lod component cache
local real_size
rm -f $file
- $LFS setstripe -E 1M -c 1 -E 2M -c 2 -E -1 -c -1 -i 1 $file ||
+ $LFS setstripe -E 1M -S 1M -c 1 -E 2M -c 2 -E -1 -c -1 -i 1 $file ||
error "Create $file failed"
dd if=/dev/zero of=$file bs=1M count=$dd_count
real_size=$(stat -c %s $file)
$LFS setstripe -d $parent || error "delete default layout"
- $LFS setstripe -E 1M -E 10M -E eof $parent/f1 || error "create f1"
+ $LFS setstripe -E 1M -S 1M -E 10M -E eof $parent/f1 || error "create f1"
$LFS setstripe -E 4M -E 20M -E eof $parent/f2 || error "create f2"
test_mkdir $parent/subdir
- $LFS setstripe -E 6M -E 30M -E eof $parent/subdir ||
+ $LFS setstripe -E 6M -S 1M -E 30M -E eof $parent/subdir ||
error "setstripe to subdir"
$LFS setstripe -E 8M -E eof $parent/subdir/f3 || error "create f3"
$LFS setstripe -c 1 $parent/subdir/f4 || error "create f4"
test_mkdir -p $DIR/$tdir
rm -f $file
- $LFS setstripe -E1m -E2m -c2 -E-1 -c-1 $file ||
+ $LFS setstripe -E 1M -S 1M -E 2M -c 2 -E -1 -c -1 $file ||
error "Create $file failed"
local s1=$($LFS getstripe -I1 -v $file | awk '/lcme_size:/{print $2}')
MEMHOG=${MEMHOG:-memhog}
DIRECTIO=${DIRECTIO:-directio}
ACCEPTOR_PORT=${ACCEPTOR_PORT:-988}
-STRIPES_PER_OBJ=-1
+DEF_STRIPE_COUNT=-1
CHECK_GRANT=${CHECK_GRANT:-"yes"}
GRANT_CHECK_LIST=${GRANT_CHECK_LIST:-""}
export PARALLEL=${PARALLEL:-"no"}
error "stripe count $($GETSTRIPE -c $MOUNT) != 1"
local default_size=$($GETSTRIPE -S $MOUNT)
local default_offset=$($GETSTRIPE -i $MOUNT)
- local dsize=$((1024 * 1024))
+ local dsize=$(do_facet $SINGLEMDS \
+ "$LCTL get_param -n lod.$(facet_svc $SINGLEMDS)*.stripesize")
[ $default_size -eq $dsize ] ||
error "stripe size $default_size != $dsize"
[ $default_offset -eq -1 ] ||error "stripe offset $default_offset != -1"
setup_56 $dir 0 $NUMDIRS
for i in $(seq $NUMDIRS); do
- $LFS setstripe -S 4M $dir/dir$i/$tfile
+ $LFS setstripe -S 8M $dir/dir$i/$tfile
done
local expected=$NUMDIRS
- local cmd="$LFS find -S 4M $dir"
+ local cmd="$LFS find -S 8M $dir"
local nums=$($cmd | wc -l)
[ $nums -eq $expected ] || {
echo -n "Creating test dir..."
test_mkdir $DIR/$tdir &> /dev/null || error "cannot create dir"
+ local def_stripe_size=$($LFS getstripe -S $DIR/$tdir 2>/dev/null)
$LFS setstripe -S 1M -c 1 "$DIR/$tdir" &> /dev/null ||
error "cannot set stripe"
echo "done"
echo -n "Verifying restripe option uses parent stripe settings..."
$LFS_MIGRATE -y -R "$file1" &> /dev/null ||
error "migrate failed"
- [ $($LFS getstripe -S "$file1") -eq 1048576 ] ||
+ [ $($LFS getstripe -S "$file1") -eq $def_stripe_size ] ||
error "file not restriped to parent settings"
[ $($LFS getstripe -c "$file1") -eq 1 ] ||
error "file not restriped to parent settings"
# Ensure striping is preserved if -R is not set, and no stripe
# count or size is specified
echo -n "Verifying striping size preserved when not specified..."
+ local orig_stripe_size=$($LFS getstripe -S "$file1" 2>/dev/null)
$LFS setstripe -S 2M -c 1 "$DIR/$tdir" &> /dev/null ||
error "cannot set stripe on parent directory"
$LFS_MIGRATE -y "$file1" &> /dev/null ||
error "migrate failed"
- [ $($LFS getstripe -S "$file1") -eq 1048576 ] ||
+ [ $($LFS getstripe -S "$file1") -eq $orig_stripe_size ] ||
error "file was restriped"
echo "done."
# Create composite files with one component
local dir=$DIR/$tdir
- setup_56 $dir/1Mfiles 5 1 "--component-end 1M"
+ setup_56 $dir/1Mfiles 5 1 "-S 1M --component-end 1M"
# Create composite files with three components
- setup_56 $dir/2Mfiles 5 2 "-E 2M -E 4M -E 6M"
+ setup_56 $dir/2Mfiles 5 2 "-E 2M -S 1M -E 4M -E 6M"
# Create non-composite files
createmany -o $dir/${tfile}- 10
test_16a() {
local file1=$DIR1/$tfile
local file2=$DIR2/$tfile
+ local stripe_size=$(do_facet $SINGLEMDS \
+ "$LCTL get_param -n lod.$(facet_svc $SINGLEMDS)*.stripesize")
# to allocate grant because it may run out due to test_15.
$LFS setstripe -c -1 $file1
- dd if=/dev/zero of=$file1 bs=$STRIPE_BYTES count=$OSTCOUNT oflag=sync
- dd if=/dev/zero of=$file2 bs=$STRIPE_BYTES count=$OSTCOUNT oflag=sync
+ dd if=/dev/zero of=$file1 bs=$stripe_size count=$OSTCOUNT oflag=sync
+ dd if=/dev/zero of=$file2 bs=$stripe_size count=$OSTCOUNT oflag=sync
rm -f $file1
$LFS setstripe -c -1 $file1 # b=10919
test_32a() { # bug 11270
local p="$TMP/$TESTSUITE-$TESTNAME.parameters"
+ local stripe_size=$(do_facet $SINGLEMDS \
+ "$LCTL get_param -n lod.$(facet_svc $SINGLEMDS)*.stripesize")
save_lustre_params client "$OSC.*.lockless_truncate" > $p
cancel_lru_locks $OSC
enable_lockless_truncate 1
rm -f $DIR1/$tfile
lfs setstripe -c -1 $DIR1/$tfile
- dd if=/dev/zero of=$DIR1/$tfile count=$OSTCOUNT bs=$STRIPE_BYTES > \
+ dd if=/dev/zero of=$DIR1/$tfile count=$OSTCOUNT bs=$stripe_size > \
/dev/null 2>&1
clear_stats $OSC.*.${OSC}_stats
if [ $type == MDS ]; then
opts+=${MDSCAPA:+" --param-mdt.capa=$MDSCAPA"}
- opts+=${STRIPE_BYTES:+" --param=lov.stripesize=$STRIPE_BYTES"}
- opts+=${STRIPES_PER_OBJ:+" --param=lov.stripecount=$STRIPES_PER_OBJ"}
+ opts+=${DEF_STRIPE_SIZE:+" --param=lov.stripesize=$DEF_STRIPE_SIZE"}
+ opts+=${DEF_STRIPE_COUNT:+" --param=lov.stripecount=$DEF_STRIPE_COUNT"}
opts+=${L_GETIDENTITY:+" --param=mdt.identity_upcall=$L_GETIDENTITY"}
if [ $fstype == ldiskfs ]; then