mirror of
https://github.com/cubefs/cubefs.git
synced 2026-08-02 02:00:56 +00:00
fix(fuse): if vol name not match regexp when mount, return failed immediately.
Signed-off-by: baihailong <baihailong@oppo.com>
This commit is contained in:
parent
6cc809434a
commit
e07aeac619
@ -374,8 +374,8 @@ func main() {
|
||||
// load conf from master
|
||||
for retry := 0; retry < MasterRetrys; retry++ {
|
||||
err = loadConfFromMaster(opt)
|
||||
// if vol not exists, not retry
|
||||
if err != nil && err.Error() != proto.ErrVolNotExists.Error() {
|
||||
// if vol not exists or vol name not match regexp, not retry
|
||||
if err != nil && err.Error() != proto.ErrVolNotExists.Error() && err.Error() != proto.ErrVolNameRegExpNotMatch.Error() {
|
||||
time.Sleep(5 * time.Second * time.Duration(retry+1))
|
||||
} else {
|
||||
break
|
||||
|
||||
@ -280,7 +280,7 @@ func parseGetVolParameter(r *http.Request) (p *getVolParameter, err error) {
|
||||
return
|
||||
}
|
||||
if !volNameRegexp.MatchString(p.name) {
|
||||
err = errors.New("name can only be number and letters")
|
||||
err = proto.ErrVolNameRegExpNotMatch
|
||||
return
|
||||
}
|
||||
if p.authKey = r.FormValue(volAuthKey); !p.skipOwnerValidation && len(p.authKey) == 0 {
|
||||
@ -1499,7 +1499,7 @@ func extractName(r *http.Request) (name string, err error) {
|
||||
return
|
||||
}
|
||||
if !volNameRegexp.MatchString(name) {
|
||||
return "", errors.New("name can only be number and letters")
|
||||
return "", proto.ErrVolNameRegExpNotMatch
|
||||
}
|
||||
|
||||
return
|
||||
|
||||
@ -106,6 +106,7 @@ var (
|
||||
ErrPerformingDecommission = errors.New("one replica is performing decommission")
|
||||
ErrWaitForAutoAddReplica = errors.New("wait for auto add replica")
|
||||
ErrBufferSizeExceedMaximum = errors.New("buffer size exceeds maximum")
|
||||
ErrVolNameRegExpNotMatch = errors.New("name can only be number and letters")
|
||||
)
|
||||
|
||||
// http response error code and error message definitions
|
||||
|
||||
Loading…
Reference in New Issue
Block a user