|
@@ -123,11 +123,14 @@ func NewFileSystemHandler(option FileSystemOption) (*FileSystemHandler, error) {
|
|
|
|
|
|
//Create the fsdb for this handler
|
|
|
var fsdb *db.Database = nil
|
|
|
- if option.Access != "readonly" {
|
|
|
- dbp, err := db.NewDatabase(filepath.ToSlash(filepath.Join(filepath.Clean(option.Path), "aofs.db")), false)
|
|
|
- if err != nil {
|
|
|
- return &FileSystemHandler{}, errors.New("Unable to create fsdb inside the target path. Is the directory read only?")
|
|
|
+
|
|
|
+ dbp, err := db.NewDatabase(filepath.ToSlash(filepath.Join(filepath.Clean(option.Path), "aofs.db")), false)
|
|
|
+ if err != nil {
|
|
|
+ if option.Access != "readonly" {
|
|
|
+ log.Println("[Filesystem] Invalid config: Trying to mount a read only path as read-write mount point. Changing " + option.Name + " mount point to READONLY.")
|
|
|
+ option.Access = "readonly"
|
|
|
}
|
|
|
+ } else {
|
|
|
fsdb = dbp
|
|
|
}
|
|
|
|