提交 dd6ad9d1 编写于 作者: J Josh Peterson 提交者: spatil

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.
上级 a5cade3e
......@@ -1794,14 +1794,15 @@ static mode_t convert_perms(guint32 sharemode)
static gboolean already_shared(gboolean file_alread_shared, ino_t inode)
{
#if HOST_DARWIN
/* On macOS and FAT32 partitions, we will sometimes get this inode value
* for more than one file. It means the file is empty (FILENO_EMPTY is
* defined in an internal header). When this happens, the hash table of
* file shares becomes corrupt, since more then one file has the same
* inode. Instead, let's assume it is always fine to share empty files.
* (Unity case 950616).
/* On macOS and FAT32 partitions, we will sometimes get an inode value
* of 999999999 (or 1 on exFAT partitions) for more than one file. It
* means the file is empty (FILENO_EMPTY is defined in an internal
* header). When this happens, the hash table of file shares becomes
* corrupt, since more then one file has the same inode. Instead, let's
* assume it is always fine to share empty files.
* (Unity case 950616 or case 1253812).
*/
return file_alread_shared && inode != 999999999;
return file_alread_shared && inode != 999999999 && inode != 1;
#else
return file_alread_shared;
#endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册