+test_131() {
+ [ "$mds1_FSTYPE" == "ldiskfs" ] || skip "ldiskfs only test"
+ do_facet mds1 $DEBUGFS -R features $(mdsdevname 1) |
+ grep -q project || skip "skip project quota not supported"
+
+ local projid
+
+ setupall
+ test_mkdir -c $MDSCOUNT -p $DIR/$tdir
+ $LFS project -p 1000 $DIR/$tdir || error "set dir project id failed"
+ createmany -o $DIR/$tdir/f 512
+ for ((i = 0; i < 512; ++i)); do
+ $LFS project -p $i $DIR/$tdir/f${i} ||
+ error "set f${i} project id failed"
+ done
+
+ test_mkdir -c $MDSCOUNT -p $DIR/$tdir.inherit
+ $LFS project -p 1001 -s $DIR/$tdir.inherit
+ createmany -o $DIR/$tdir.inherit/f 128
+ (( $($LFS project $DIR/$tdir.inherit/f* |
+ awk '$1 == 1001 { print }' | wc -l) == 128 )) ||
+ error "files did not inherit projid 1001"
+
+ stopall
+
+ for i in $(seq $MDSCOUNT); do
+ mds_backup_restore mds$i ||
+ error "Backup/restore on mds$i failed"
+ done
+
+ setupall
+
+ projid=($($LFS project -d $DIR/$tdir))
+ [ ${projid[0]} == "1000" ] ||
+ error "projid expected 1000 not ${projid[0]}"
+ for ((i = 0; i < 512; ++i)); do
+ projid=($($LFS project $DIR/$tdir/f${i}))
+ [ ${projid[0]} == "$i" ] ||
+ error "projid expected $i not ${projid[0]}"
+ done
+
+ (( $($LFS project $DIR/$tdir.inherit/f* |
+ awk '$1 == 1001 { print }' | wc -l) == 128 )) ||
+ error "restore did not copy projid 1001"
+}
+run_test 131 "MDT backup restore with project ID"
+
+test_132() {
+ local err_cnt
+ local err_cnt2
+
+ reformat
+ combined_mgs_mds || start_mgs || error "unable to start MGS"
+ start_mdt 1 || error "unable to start mdt1"
+
+ err_cnt=$(do_facet mds1 dmesg | grep -c "cannot take the layout locks")
+ stop_mdt 1 || error "stop mdt1 failed"
+
+ [ "$mds1_FSTYPE" == zfs ] && import_zpool mds1
+ do_facet mds1 $TUNEFS --param mdt.hsm_control=enabled $(mdsdevname 1) ||
+ error "tunefs failed"
+ start_mdt 1 || error "cannot start mdt1"
+
+ err_cnt2=$(do_facet mds1 dmesg | grep -c "cannot take the layout locks")
+ [ $err_cnt -eq $err_cnt2 ] || error "Can not take the layout lock"
+ stop_mdt 1 || error "stop mdt1 failed"
+}
+run_test 132 "hsm_actions processed after failover"
+