Skip to content

Commit cab6e38

Browse files
Josh PetersonUnityAlex
authored andcommitted
Correct file sharing for exFAT partitions on macOS (case 1253812)
This change applies a similar fix for exFAT partitions as was applied for FAT32 partitions earlier. For exFAT partitions, the invalid inode value seems to be 1 though.
1 parent ecf9698 commit cab6e38

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

mono/metadata/w32file-unix.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1840,14 +1840,15 @@ static mode_t convert_perms(guint32 sharemode)
18401840
static gboolean already_shared(gboolean file_alread_shared, ino_t inode)
18411841
{
18421842
#if HOST_DARWIN
1843-
/* On macOS and FAT32 partitions, we will sometimes get this inode value
1844-
* for more than one file. It means the file is empty (FILENO_EMPTY is
1845-
* defined in an internal header). When this happens, the hash table of
1846-
* file shares becomes corrupt, since more then one file has the same
1847-
* inode. Instead, let's assume it is always fine to share empty files.
1848-
* (Unity case 950616).
1843+
/* On macOS and FAT32 partitions, we will sometimes get an inode value
1844+
* of 999999999 (or 1 on exFAT partitions) for more than one file. It
1845+
* means the file is empty (FILENO_EMPTY is defined in an internal
1846+
* header). When this happens, the hash table of file shares becomes
1847+
* corrupt, since more then one file has the same inode. Instead, let's
1848+
* assume it is always fine to share empty files.
1849+
* (Unity case 950616 or case 1253812).
18491850
*/
1850-
return file_alread_shared && inode != 999999999;
1851+
return file_alread_shared && inode != 999999999 && inode != 1;
18511852
#else
18521853
return file_alread_shared;
18531854
#endif

0 commit comments

Comments
 (0)