labring / sealfs

The storage system of sealos, aims to be a high-performance, high-reliability, and auto-scaling distributed file system
Apache License 2.0
141 stars 20 forks source link

Key in dir_db may conflicts #151

Closed luanshaotong closed 1 year ago

luanshaotong commented 1 year ago

https://github.com/labring/sealfs/blob/47cc78fa3347bab6a29ce75e994f80935773001e/src/server/storage_engine/meta_engine.rs#L239

Fisrt create a dir with path "/a". Then create a file with path "/a/a". Now there is a record of "/a-a-f" in db.

Next if we create a dir with path "/a-a-f", may lead to record conflicts. And even create a file of "/a-a-a", may also cause the read dir error at https://github.com/labring/sealfs/blob/47cc78fa3347bab6a29ce75e994f80935773001e/src/server/storage_engine/meta_engine.rs#L188

luanshaotong commented 1 year ago

@uran0sH