+test_124() {
+ [ -z "`grep lru_resize $LPROC/mdc/*/connect_flags`" ] && \
+ skip "no lru resize on server" && return 0
+ cancel_lru_locks mdc
+ lru_resize_enable
+ NSDIR=`find $LPROC/ldlm/namespaces | grep mdc | head -1`
+
+ # we want to test main pool functionality, that is cancel based on SLV
+ # this is why shrinkers are disabled
+ disable_pool_shrink "mds-$FSNAME"
+ disable_pool_shrink mdc
+
+ NR=2000
+ mkdir -p $DIR/$tdir || error "failed to create $DIR/$tdir"
+
+ LRU_SIZE=`cat $NSDIR/lru_size`
+
+ # use touch to produce $NR new locks
+ log "create $NR files at $DIR/$tdir"
+ for ((i=0;i<$NR;i++)); do touch $DIR/$tdir/f$i; done
+
+ LRU_SIZE_B=`cat $NSDIR/lru_size`
+ if test $LRU_SIZE -ge $LRU_SIZE_B; then
+ skip "No cached locks created!"
+ cat $NSDIR/pool/state
+ return 0
+ fi
+ LRU_SIZE_B=$((LRU_SIZE_B-LRU_SIZE))
+ log "created $LRU_SIZE_B lock(s)"
+
+ # we want to sleep 30s to not make test too long
+ SLEEP=30
+ SLEEP_ADD=10
+
+ # we know that lru resize allows one client to hold $LIMIT locks for 10h
+ MAX_HRS=10
+
+ # get the pool limit
+ LIMIT=`cat $NSDIR/pool/limit`
+
+ # calculate lock volume factor taking into account sleep and data set
+ # use $LRU_SIZE_B here to take into account real number of locks created
+ # in the case of CMD, LRU_SIZE_B != $NR in most of cases
+ LVF=$(($LIMIT * $MAX_HRS * 60 * 60 / $LRU_SIZE_B / $SLEEP))
+
+ log "make client drop locks $LVF times faster so that ${SLEEP}s is enough to cancel $LRU_SIZE_B lock(s)"
+ OLD_LVF=`cat $NSDIR/pool/lock_volume_factor`
+ echo "$LVF" > $NSDIR/pool/lock_volume_factor
+ log "sleep for "$((SLEEP+SLEEP_ADD))"s"
+ sleep $((SLEEP+SLEEP_ADD))
+ echo "$OLD_LVF" > $NSDIR/pool/lock_volume_factor
+ LRU_SIZE_A=`cat $NSDIR/lru_size`
+
+ [ $LRU_SIZE_B -ge $LRU_SIZE_A ] || {
+ error "No locks dropped in "$((SLEEP+SLEEP_ADD))"s. LRU size: $LRU_SIZE_A"
+ lru_resize_enable
+ unlinkmany $DIR/$tdir/f $NR
+ return
+ }
+
+ log "Dropped "$((LRU_SIZE_B-LRU_SIZE_A))" locks in "$((SLEEP+SLEEP_ADD))"s"
+ lru_resize_enable
+ log "unlink $NR files at $DIR/$tdir"
+ unlinkmany $DIR/$tdir/f $NR
+}
+run_test 124 "lru resize ======================================="
+
+test_125() { # 13358
+ mkdir -p $DIR/d125 || error "mkdir failed"
+ $SETSTRIPE $DIR/d125 65536 -1 -1 || error "setstripe failed"
+ setfacl -R -m u:bin:rwx $DIR/d125 || error "setfacl $DIR/d125 failed"
+ ls -ld $DIR/d125 || error "cannot access $DIR/d125"
+}
+run_test 125 "don't return EPROTO when a dir has a non-default striping and ACLs"