From 2dc781635c24fb0c7d30a713ec44fa5cd314bc3a Mon Sep 17 00:00:00 2001 From: Simon Frei Date: Mon, 22 Jun 2020 15:47:11 +0200 Subject: [PATCH] Updated Filesystem Case Sensitivity (markdown) --- Filesystem-Case-Sensitivity.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Filesystem-Case-Sensitivity.md b/Filesystem-Case-Sensitivity.md index dbcb8de..c554ec4 100644 --- a/Filesystem-Case-Sensitivity.md +++ b/Filesystem-Case-Sensitivity.md @@ -45,7 +45,15 @@ The basic premise is to leave the db alone, and add a way to detect and use the ### Scanner -Walking a filesystem already does report the real names. Case problems arise because of the second scanner step where deletions are detected by stating filenames as present in the db. The proposal here is to avoid that second step by directly comparing db contents while walking the filesystem, i.e. do https://github.com/syncthing/syncthing/pull/4584 again (PR status is merged, but was reverted later). +Walking a filesystem already does report the real names. Case problems arise because of the second scanner step where deletions are detected by stating filenames as present in the db. + +Instead of simple stating, use `DirNames` to get all existing names. Cache results somehow to prevent tons of `DirNames` calls for the same path (tree of path components, stack of results, ...). + +Unfortunately defective initial attempt: + +The following mechanism relies on path ordering, however that's not consistent between walking fs and db. The fs is ordered lexically by path components while the db is ordered lexically by path. E.g. fs goes a -> a/a -> a-a while the db goes a -> a-a -> a/a. And it's not solvable by not going depth first on the fs, as then on fs it would be a -> aaa -> a/a and in db a -> a/a -> aaa. + +The proposal here is to avoid that second step by directly comparing db contents while walking the filesystem, i.e. do https://github.com/syncthing/syncthing/pull/4584 again (PR status is merged, but was reverted later). This means after a scan, all filenames in the db correspond to the real case on disk, regardless of the scenario (e.g. picks up case only renames on windows). This does not require any special treatment for case-insensitive systems and is beneficial to other systems as well, as we will do just one iteration instead of the two now. ### Puller