* message buffers. */
if (req->rq_export == NULL) {
- struct ldlm_request *dlm_req;
-
- CDEBUG(D_RPCTRACE, "operation %d from %s with bad "
- "export cookie "LPX64"; this is "
- "normal if this node rebooted with a lock held\n",
- lustre_msg_get_opc(req->rq_reqmsg),
- libcfs_id2str(req->rq_peer),
- lustre_msg_get_handle(req->rq_reqmsg)->cookie);
-
- dlm_req = lustre_swab_reqbuf(req, DLM_LOCKREQ_OFF,
- sizeof(*dlm_req),
- lustre_swab_ldlm_request);
- if (dlm_req != NULL)
- CDEBUG(D_RPCTRACE, "--> lock cookie: "LPX64"\n",
- dlm_req->lock_handle[0].cookie);
-
ldlm_callback_reply(req, -ENOTCONN);
RETURN(0);
}
# resetquota -g groupname
resetquota() {
- [ "$#" != 2 ] && error "resetquota: wrong number of arguments: $#"
- [ "$1" != "-u" -a "$1" != "-g" ] && error "resetquota: wrong specifier $1 passed"
- $LFS setquota "$1" "$2" -b 0 -B 0 -i 0 -I 0 $MOUNT || error "resetquota failed"
+ [ "$#" != 2 ] && error "resetquota: wrong number of arguments: $#"
+ [ "$1" != "-u" -a "$1" != "-g" ] && error "resetquota: wrong specifier $1 passed"
+
+ count=0
+ if at_is_valid && at_is_enabled; then
+ timeout=$(at_max_get mds)
+ else
+ timeout=$(lctl get_param -n timeout)
+ fi
+
+ while [ $((count++)) -lt $timeout ]; do
+ $LFS setquota "$1" "$2" -b 0 -B 0 -i 0 -I 0 $MOUNT
+ RC=$?
+ if [ $RC -ne 0 ]; then
+ if [ $RC -eq 240 ]; then # 240 means -EBUSY
+ log "resetquota is blocked for quota master recovery, retry after 1 sec"
+ sleep 1
+ continue
+ else
+ error "resetquota failed: $RC"
+ fi
+ fi
+ break
+ done
+
+ [ $count -lt $timeout ] || error "resetquota timeout: $timeout"
}
quota_scan() {
if [ "$LOCAL_BF" == "a" -o "$LOCAL_BF" == "b" ]; then
USAGE="`$LFS quota -$LOCAL_UG $LOCAL_ID $DIR | awk '/^.*'$PATTERN'.*[[:digit:]+][[:space:]+]/ { print $2 }'`"
- [ $USAGE -ne 0 ] && quota_log $LOCAL_UG $LOCAL_ID "System is not clean for block ($LOCAL_UG:$LOCAL_ID:$USAGE)."
+ if [ -z $USAGE ]; then
+ quota_error $LOCAL_UG $LOCAL_ID "System is error when query quota for block ($LOCAL_UG:$LOCAL_ID)."
+ else
+ [ $USAGE -ne 0 ] && quota_log $LOCAL_UG $LOCAL_ID "System is not clean for block ($LOCAL_UG:$LOCAL_ID:$USAGE)."
+ fi
fi
if [ "$LOCAL_BF" == "a" -o "$LOCAL_BF" == "f" ]; then
USAGE="`$LFS quota -$LOCAL_UG $LOCAL_ID $DIR | awk '/^.*'$PATTERN'.*[[:digit:]+][[:space:]+]/ { print $5 }'`"
- [ $USAGE -ne 0 ] && quota_log $LOCAL_UG $LOCAL_ID "System is not clean for file ($LOCAL_UG:$LOCAL_ID:$USAGE)."
+ if [ -z $USAGE ]; then
+ quota_error $LOCAL_UG $LOCAL_ID "System is error when query quota for file ($LOCAL_UG:$LOCAL_ID)."
+ else
+ [ $USAGE -ne 0 ] && quota_log $LOCAL_UG $LOCAL_ID "System is not clean for file ($LOCAL_UG:$LOCAL_ID:$USAGE)."
+ fi
fi
}
sleep 1
done
log "(dd_pid=$DDPID, time=$count, timeout=$timeout)"
+ sync
+ cancel_lru_locks mdc
+ cancel_lru_locks osc
testfile_size=$(stat -c %s $TESTFILE)
[ $testfile_size -ne $((BLK_SZ * 1024 * 100)) ] && \
quota_error u $TSTUSR "expect $((BLK_SZ * 1024 * 100)), got ${testfile_size}. Verifying file failed!"
- rm -f $TESTFILE
- sync; sleep 3; sync;
+ $SHOW_QUOTA_USER
+ rm -f $TESTFILE
+ sync
resetquota -u $TSTUSR
-
set_blk_unitsz $((128 * 1024))
set_blk_tunesz $((128 * 1024 / 2))
}
log "(dd_pid=$DDPID, time=$count, timeout=$timeout)"
lustre_fail mds 0
-
rm -f $TESTFILE
- sync; sleep 3; sync;
+ sync
resetquota -u $TSTUSR
-
set_blk_unitsz $((128 * 1024))
set_blk_tunesz $((128 * 1024 / 2))
}
sleep 1
done
log "(dd_pid=$DDPID, time=$count, timeout=$timeout)"
- sync; sleep 1; sync
+ sync
+ cancel_lru_locks mdc
+ cancel_lru_locks osc
testfile_size=$(stat -c %s $TESTFILE)
[ $testfile_size -ne $((BLK_SZ * 1024 * 100)) ] && \
quota_error u $TSTUSR "expect $((BLK_SZ * 1024 * 100)), got ${testfile_size}. Verifying file failed!"
$SHOW_QUOTA_USER
- resetquota -u $TSTUSR
- rm -rf $TESTFILE
- sync; sleep 1; sync
+ rm -f $TESTFILE
+ sync
+
+ resetquota -u $TSTUSR
+ set_blk_unitsz $((128 * 1024))
+ set_blk_tunesz $((128 * 1024 / 2))
}
# test when mds does failover, the ost still could work well
log " Step1: done"
log " Step2: rewrite should succeed"
- $RUNAS $DIRECTIO write $TESTFILE $(($LIMIT/1024/2)) 1 $bs_unit || quota_error u $TSTUSR "(3) write failure, but expect success: $LIMIT"
+ $RUNAS $DIRECTIO write $TESTFILE 0 1 $bs_unit || quota_error u $TSTUSR "(3) write failure, but expect success: $LIMIT"
log " Step2: done"
rm -f $TESTFILE