Skip to content
Tcl Source Code History Of Ticket 4ae42446ab
Login

History Of Ticket 4ae42446ab

Artifacts Associated With Ticket 4ae42446ab

  1. Ticket change [d1ded63135] (rid 217907) by apnadkarni on 2023-09-09 17:44:12:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/x-markdown"
    4. comment initialized to:
      Easiest described with an example. `test.zip` contains the directory `testdir` with the file `test2`. `teststored.zip` contains a file `abac-repeat.txt`.
      
      ```
      % zipfs mount //zipfs:/test ../tests/zipfiles/test.zip
      % glob -tails -dir //zipfs:/test/testdir *
      test2
      
      % zipfs mount //zipfs:/temp ../tests/zipfiles/teststored.zip
      % glob -tails -dir //zipfs:/temp *
      abac-repeat.txt
      ```
      
      Now instead if we mount `teststored.zip` on a path **inside** the `test.zip` archive, we get
      
      ```
      % zipfs mount //zipfs:/test/testdir ../tests/zipfiles/teststored.zip
      % glob -tails -dir //zipfs:/test/testdir *
      test2 abac-repeat.txt
      ```
      
      As seen above, //zipfs:/test/testdir now shows files from **both** archives. While one might be tempted to call this a "feature", I believe it is purely accidental. For one, afaik this is not how most operating system mounts behave. Second, when duplicate names are present, one of the two are hidden depending on order of mounting and **are not recovered** when the overlaid archive is unmounted, which is confusing.
      
      In my mind, the code should be changed to either
      
      1. Disallow mount points within mounted archives, or
      
      2. Disallow mount points if the mount point is an existing directory (may be empty directories could be allowed)
      
    5. foundin initialized to: "8.7"
    6. is_private initialized to: "0"
    7. login: "apnadkarni"
    8. priority initialized to: "5 Medium"
    9. private_contact initialized to: "9546e9877f1a8899e25a89082561ee694e7fb402"
    10. resolution initialized to: "None"
    11. severity initialized to: "Minor"
    12. status initialized to: "Open"
    13. submitter initialized to: "apnadkarni"
    14. subsystem initialized to: "- New Builtin Commands"
    15. title initialized to: "overlaid zipfs mounts co-mingle directory contents"
    16. type initialized to: "Bug"
  2. Ticket change [08e67b6239] (rid 217914) by griffin on 2023-09-09 18:37:07:

    1. icomment:
      FYI: Not to discount this issue, but there does exist "overlay filesystems" that intentionally mingle files from 1 or more "overlays".  The intent is to allow access to a collection of files and also allow writing new or modifying exiting files to the same directory, without actually modifying the underlying "pristine" content. This technique can be used to share a base set of files with multiple processes where each process may add or modify files to the same directory. The commingling of files in one process does not interfere with the other process if each process has a separate dependent overlay.
      
    2. login: "griffin"
    3. mimetype: "text/x-markdown"
  3. Ticket change [140b8e9fc9] (rid 217915) by juliannoble2 on 2023-09-09 21:00:19:

    1. icomment:
      Regarding "Disallow mount points if the mount point is an existing directory (may be empty directories could be allowed)"
      
      I would like to gently argue against this restriction. 
      
      I recall using a 'virtual directory' feature of some half-forgotten webserver years ago where you could override an underlying folder which might have a default page/script for example as a fallback.
      
      I would like to have the ability to mount over a folder with or without existing content if possible.
      
      Features like overlays which combine the contents could be nice if it was well defined and optional/configurable - but that's getting fancy.
      
      My request doesn't make as much sense in an environment where we are restricting zipfs mounts to a specific volume - but I'm hopeful some consideration can also be given as to whether the builtin zipfs can default to using a volume but allow arbitrary mount points in future. I'm guessing that may need a tip - but let's not rule it out unless we have to.
      
    2. login: "juliannoble2"
    3. mimetype: "text/plain"
  4. Ticket change [4fe854ae2a] (rid 217916) by apnadkarni on 2023-09-10 04:01:30:

    1. icomment:
      @griffin, @juliannoble2, noted. What gives me pause is that the current behavior seems to be purely accidental as a result of a single "flat" hash table being used to store paths.
      
      - When an overlay has conflicts with the existing mounts, the existing mounts win (i.e. if you mount a.zip and b.zip both containing file X in that order, the a.zip's X is preserved). This seems slightly counterintuitive to me but in any case the comment in the code ["This should not happen"](https://core.tcl-lang.org/tcl/file?ci=d46e5f18434976e3&name=generic/tclZipfs.c&ln=1759) which skips b.zip's version implies it was not by design. Any time, I see code that "should not be reached" is reached, it is a point of worry!
      
      - More important, I would expect that when one of the archives is unmounted, the full contents of the other one that is still mounted are seen. This is not the case as the common entries are simply removed from the hash table. Looking at the code, it **seems** to me non-trivial re-implementation will be needed to fix this, something that I would be hesitant to introduce for this release. Maybe if @chw's directory caching implementation is picked up, this can be fixed as well.
      
      Perhaps this issue is a corner case not sufficiently important to address at this point in time.
      
    2. login: "apnadkarni"
    3. mimetype: "text/x-markdown"
  5. Ticket change [4a1894d051] (rid 217934) by apnadkarni on 2023-09-10 10:59:42:

    1. icomment:
      Just for the record - dual behavior as file and directory.
      
      ```
      % glob -dir //zipfs:/test/test *
      //zipfs:/test/test/test3 //zipfs:/test/test/test2
      % file type //zipfs:/test/test
      file
      % cd //zipfs:/test/test
      couldn't change working directory to "//zipfs:/test/test": no such file or directory
      ```
      
      I can't put my finger on what problems this might cause but these inconsistencies make me uncomfortable. In any case, will abandon adding test cases in this area until there is some consensus as to the correct behavior.
      
    2. login: "apnadkarni"
    3. mimetype: "text/plain"