From 23107483a126a53419cbf18f8fbdecf937f0d0a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=83=E7=9F=B3?= Date: Thu, 4 Sep 2025 22:14:33 +0800 Subject: [PATCH] Refactor (storage): Comment out the path validation logic (#9308) - Comment out the error return logic for paths with "/" - Remove storage path restrictions to allow for flexible handling of root paths --- internal/op/storage.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/internal/op/storage.go b/internal/op/storage.go index 5ab1da18..27221e70 100644 --- a/internal/op/storage.go +++ b/internal/op/storage.go @@ -47,9 +47,9 @@ func CreateStorage(ctx context.Context, storage model.Storage) (uint, error) { storage.Modified = time.Now() storage.MountPath = utils.FixAndCleanPath(storage.MountPath) - if storage.MountPath == "/" { - return 0, errors.New("Mount path cannot be '/'") - } + //if storage.MountPath == "/" { + // return 0, errors.New("Mount path cannot be '/'") + //} var err error // check driver first @@ -210,9 +210,9 @@ func UpdateStorage(ctx context.Context, storage model.Storage) error { } storage.Modified = time.Now() storage.MountPath = utils.FixAndCleanPath(storage.MountPath) - if storage.MountPath == "/" { - return errors.New("Mount path cannot be '/'") - } + //if storage.MountPath == "/" { + // return errors.New("Mount path cannot be '/'") + //} err = db.UpdateStorage(&storage) if err != nil { return errors.WithMessage(err, "failed update storage in database")