@@ -239,7 +239,7 @@ def hash_timestamp(afile):
239
239
240
240
241
241
def _generate_cifs_table ():
242
- """Construct a reverse-length ordered list of mount points that
242
+ """Construct a reverse-length- ordered list of mount points that
243
243
fall under a CIFS mount.
244
244
245
245
This precomputation allows efficient checking for whether a given path
@@ -258,8 +258,6 @@ def _generate_cifs_table():
258
258
key = lambda x : len (x [0 ]),
259
259
reverse = True )
260
260
cifs_paths = [path for path , fstype in mount_info if fstype == 'cifs' ]
261
- if cifs_paths == []:
262
- return []
263
261
264
262
return [mount for mount in mount_info
265
263
if any (mount [0 ].startswith (path ) for path in cifs_paths )]
@@ -269,14 +267,19 @@ def _generate_cifs_table():
269
267
270
268
271
269
def on_cifs (fname ):
272
- """ Checks whether a PATH is on a CIFS filesystem mounted in a POSIX
273
- host (i.e., has the "mount" command).
270
+ """ Checks whether a file path is on a CIFS filesystem mounted in a POSIX
271
+ host (i.e., has the ``mount`` command).
272
+
273
+ On Windows, Docker mounts host directories into containers through CIFS
274
+ shares, which has support for Minshall+French symlinks, or text files that
275
+ the CIFS driver exposes to the OS as symlinks.
276
+ We have found that under concurrent access to the filesystem, this feature
277
+ can result in failures to create or read recently-created symlinks,
278
+ leading to inconsistent behavior and ``FileNotFoundError``s.
274
279
275
- CIFS shares are how Docker mounts Windows host directories into containers.
276
- CIFS has partial support for symlinks that can break, causing misleading
277
- errors, so this test is used to disable them on such systems.
280
+ This check is written to support disabling symlinks on CIFS shares.
278
281
"""
279
- # Only the first match counts
282
+ # Only the first match (most recent parent) counts
280
283
for fspath , fstype in _cifs_table :
281
284
if fname .startswith (fspath ):
282
285
return fstype == 'cifs'
0 commit comments