简体   繁体   English

OSXFUSE - “本地”挂载选项到底意味着什么?

[英]OSXFUSE - what exactly does the “local” mount option mean?

I've implemented an OSXFUSE-based file system. 我已经实现了一个基于OSXFUSE的文件系统。 It works fine on 10.8, but on Mavericks MS Word opens existing documents as blank (although I am, apparently, returning the correct data - I see the contents in the preview icon. Also, if I copy a file to a real hard drive and open it, it opens fine). 它在10.8上工作正常,但在Mavericks上,MS Word将现有文档打开为空白(虽然我显然正在返回正确的数据 - 我在预览图标中看到了内容。另外,如果我将文件复制到真正的硬盘驱动器上打开它,打开很好)。

This issue is fixed on Mavericks if I mount my filesystem with the "local" flag. 如果我使用“local”标志挂载我的文件系统,则会在Mavericks上修复此问题。 However, using this flag introduces other problems - eg, it looks like it causes Finder to do some more aggressive caching, hence some file are not visible in Finder (although I can ls them in terminal). 但是,使用此标志会引入其他问题 - 例如,它看起来会导致Finder进行更积极的缓存,因此在Finder中看不到某些文件(尽管我可以在终端中看到它们)。

Ideally I want to be able to mount the filesystem without this local flag (my implementation stores file on the network, so passing this flag looks wrong), but the problem with blank Word documents really puzzles me. 理想情况下,我希望能够在没有此本地标志的情况下挂载文件系统(我的实现将文件存储在网络上,因此传递此标志看起来不对),但空白Word文档的问题确实让我感到困惑。

I've seen the same and likewise local is not an option. 我已经看到了同样的情况,同样本地也不是一种选择。 Similar problems with Photoshop. 与Photoshop类似的问题。

Some findings from my implementation 我的实施的一些发现

  • The problem doesn't occur on first run after reboots. 重新启动后首次运行时不会发生此问题。
  • The problem begins occurring after program exit. 程序退出后问题就开始了。
  • I solved this problem by manually dismounting (and waiting a few seconds) before exiting my program. 我在退出程序之前通过手动卸载(并等待几秒钟)解决了这个问题。 If unmount is successful, on next run the mount again performs fine. 如果卸载成功,则在下次运行时,mount再次执行正常。
  • If the program ever terminates or dismounting fails (file in use, etc) then the volume's read-access is borked in Word/Photoshop on next mount. 如果程序终止或卸载失败(正在使用的文件等),那么下次安装时,卷的读取访问将在Word / Photoshop中被识别。
  • Rebooting resolves issue. 重新启动解决问题。

Does this match what you're seeing? 这符合你所看到的吗?

We have been able to track down the problem to - wait for it - Google Chrome. 我们已经能够追踪问题 - 等待它 - Google Chrome。 When Google Chrome is running while the volume is mounted, the problem appears. 在装入卷时运行Google Chrome时,会出现问题。 If Google Chrome is not running, Word/Excel/etc. 如果谷歌Chrome没有运行,Word / Excel /等。 files open just fine. 文件打开就好了。

We've been in contact with Benjamin (OSXFUSE developer). 我们一直与Benjamin(OSXFUSE开发人员)联系。 Please also see his answer regarding this issue on the OSXFUSE mailing list: 另请参阅OSXFUSE邮件列表中有关此问题的答案:

https://groups.google.com/d/msg/osxfuse-group/URlw-n-Qakg/bLw2fHHDe7sJ https://groups.google.com/d/msg/osxfuse-group/URlw-n-Qakg/bLw2fHHDe7sJ

So far I have not found any bugs in osxfuse that might explain this behavior. 到目前为止,我还没有在osxfuse中发现任何可能解释此行为的错误。 The odd thing is that the files are not corrupted or empty. 奇怪的是文件没有损坏或空。 After copying the files to another volume they open just fine. 将文件复制到另一个卷后,它们就可以正常打开了。 Using LibreOffice to open the file on the FUSE volume works, too. 使用LibreOffice打开FUSE卷上的文件也可以。

Chrome and Office seem to be based on the Carbon framework (which is deprecated since Mountain Lion). Chrome和Office似乎基于Carbon框架(自Mountain Lion以来已弃用)。 I believe the issue is somehow related to Carbon since non-Carbon apps do not seem to be affected. 我认为这个问题与Carbon有某种关系,因为非Carbon应用程序似乎没有受到影响。 Every time a volume is mounted Chrome queries the volume's capabilities and attributes (and maybe more). 每次安装卷时,Chrome都会查询卷的功能和属性(可能还有更多)。 As far as I can tell all these file system operations return successful without any errors. 据我所知,所有这些文件系统操作返回成功没有任何错误。 But from this point on Office will fail to open documents. 但从这一点上Office将无法打开文档。

In my opinion the two most likely reasons for this are: 在我看来,两个最可能的原因是:

  1. osxfuse might break the VFS file system contract on Mavericks. osxfuse可能会破坏Mavericks上的VFS文件系统合同。 I've been looking into this for some time now but I have not found any clues supporting this. 我一直在研究这个问题已有一段时间,但我没有找到任何支持这一点的线索。
  2. There might be a bug in the Carbon/CarbonCore framework. Carbon / CarbonCore框架中可能存在错误。 The odd thing is that there are no issues when using the stock network file systems afp or smb. 奇怪的是,使用股票网络文件系统afp或smb时没有问题。

The two possible "fixes" (or rather "workarounds") for this issue seem to be (for now): 这个问题的两个可能的“修复”(或者更确切地说是“解决方法”)似乎是(现在):

  1. Use the "local" mount option (which might introduce other problems and is generally not recommend to use) 使用“本地”挂载选项(可能会引入其他问题,通常不建议使用)
  2. Do not use the "volname" mount option. 不要使用“volname”挂载选项。 The problem seems only to occur when the "volname" mount option is used. 只有在使用“volname”挂载选项时才会出现此问题。 If no custom volume name is set, the problem seems not to occur and Excel/Word/etc. 如果未设置自定义卷名称,则问题似乎不会发生,并且Excel / Word /等。 files open just fine - regardless whether Google Chrome was running at mount time. 文件打开就好 - 无论Google Chrome是否在挂载时运行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM