-
Notifications
You must be signed in to change notification settings - Fork 262
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
macOS uses inode number 1 on exFAT #585
Comments
Oh dear that's not good |
Can you run statfs ( https://github.com/rfjakob/gocryptfs/tree/master/contrib/statfs , run "go build" there and you get the executable) on foo ? I need to get the filesystem id for exfat so I can detect it on startup. |
This should be the relevant output for exFAT:
Just for completion, this is the output for APFS
|
Perfect, thanks! Could you try passing -sharedstorage on mounting? This should work around the issue, as it disables hard links. |
This worked. Now gocryptfs v2.0.1 has no problems anymore, even though on the exFAT disk there are still files with inode id 1. Thank you. What are the downsides of this? |
Downside is that metadata caching is disabled, leading to slower operation. Second downside is that this workaround probably stopped working with 1bc1db6 just now. |
The root directory always get nodeid 1, and the v2 api originally had "nodeid == inode number". But since 1d0096e, inode number and node id are independent, and we can allow inode number 1. Why does this matter? MacOS actually uses inode number 1 on ExFAT mounts, triggering a panic on overlay filesystems like gocryptfs: panic: using reserved ID 1 for inode number Fixes: rfjakob/gocryptfs#585 Change-Id: I5e3476da65400d32efdb3dac1fe4901c64c00a89
Let's not crash anymore when we see inode number 1 ( hanwen/go-fuse@0aaef6d ) #585
Ok, final workaround merged just now. Could you test? You should see
|
c3c9513 works like a charm now, except that I didn't see that message. |
Hmm the missing message worries me a bit, but maybe it went to syslog. Could you try again with |
Here:
I tried with -sharedstorage, too, but it doesn't show up there either. When exactly is the message expected to appear? |
Message is:
|
Just in case, you need the statfs again (performed on the encrypted directory):
|
Oh dear, "Type" is 40 now. It was 35 in your earlier post |
That is really strange. |
Oh, maybe: |
We need to look at f_fstypename acc. to https://stackoverflow.com/a/52299141/1380267 : > As filesystem type numbers are now assigned at runtime in > recent versions of MacOS, you must use f_fstypename to > determine the type. #585
@ueberbelichtetesfoto could you try again with latest master? I check f_fstypename now, which should be stable, but, lacking a Mac, could not test it. |
Will take some time. Next time I can test will be this weekend. |
I think this looks as you wanted it to be:
Also creating and dealing with empty files works just fine. Edit: Creating two empty files leads to the two files sharing the inode number 1. |
Yes looks good, thanks for testing!
Yes, they internally get a different identifier called "generation number", but to the user only the inode number is visible.
Not needed, no! |
As referenced in #556, starting from this comment #556 (comment) I hijacked the issue to discover that macOS uses the inode number 1 on an exFAT filesystem.
This leads to the error message
panic: using reserved ID 1 for inode number
when using gocryptfs later than v1.8.0.
Regarding @rfjakob's request
Interestingly:
But that's probably some optimization, because:
The problem with macOS is probably, that when opening a directory in the Finder, the Finder immediately places a file called .DS_Store in that directory.
This file stores things like how the folder's contents should be displayed, such as list, details or symbols, and in the case of the latter, the specific positions of these symbols.
Initially this file is empty, and thus probably gets inode number 1, once the directory is opened for the first time in the Finder.
Thus: When one only works with directories on the command line and never creates empty files, this issue is unlikely to hit anybody.
The question remains, why gocryptfs v1.8.0 is unaffected.
Probably because of go-fuse?
Edit: Interestingly this "empty file inode number 1 sharing" does not happen on macOS's native APFS:
The text was updated successfully, but these errors were encountered: