Skip to content
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

[OS X] [APFS] Make sure our file system unicode normalization will be correct #5650

Closed
guruz opened this issue Mar 25, 2017 · 20 comments
Closed
Assignees
Labels
Discussion p2-high Escalation, on top of current planning, release blocker

Comments

@guruz guruz added the p2-high Escalation, on top of current planning, release blocker label Mar 25, 2017
@guruz guruz added this to the 2.3.2 milestone Mar 25, 2017
@ogoffart
Copy link
Contributor

ogoffart commented Apr 4, 2017

For writing file, we only rely on Qt, in the propagator, which should normalize filenames, i believe.
When reading file in the update phase, on mac, we normalize their name already (with iconv)

In other words, I believe we should be fine. But it's worth testing.

@guruz guruz modified the milestones: 2.4.0, 2.3.2 Apr 21, 2017
@guruz
Copy link
Contributor Author

guruz commented Apr 21, 2017

Moving to 2.4, we should probably go with the approach of using Qt for directory iteration and stat()ing as mentioned in #5661 (comment)

@guruz
Copy link
Contributor Author

guruz commented Jul 11, 2017

@jturcotte Is your macOS version able to create disk images with APFS?

@guruz
Copy link
Contributor Author

guruz commented Jul 11, 2017

From https://mjtsai.com/blog/2017/06/27/apfs-native-normalization/

The default for macOS 10.13 will be case-insensitive APFS. It is normalization-preserving (unlike HFS+) but not normalization-sensitive. I expect this to be highly compatible with existing Mac apps. The main difference is that when you read filenames they are no longer necessarily in Form D, but you shouldn’t have been relying on that, anyway.

@guruz
Copy link
Contributor Author

guruz commented Jul 11, 2017

TODO:

@ogoffart
Copy link
Contributor

It is normalization-preserving (unlike HFS+) but not normalization-sensitive.

Then there should not be any problem. We already normalize anyway on mac.
The issues might be that we always write in the Form D, even if it was on the disk with another form. Since it is "not normalization-sensitive", that will not be a problem for owncloud itself. However, if there are application that rely on a filename NOT to be in the D form, this might be a problem when we update a file from the server. (Such application would be currently broken with HFS+, so that's only future applications)

So I bet there won't be issues.

@jturcotte
Copy link
Member

@guruz Doesn't look like I can for a .dmg, only Mac OS Journaled, ExFAT and FAT.

@guruz
Copy link
Contributor Author

guruz commented Jul 14, 2017

Test that 2.4.0 is OK after having #5875

On my Sierra Mac 10.12.5 it does NOT work. A file Amélie (filename created on shell using touch copy pasted from https://en.wikipedia.org/wiki/Unicode_equivalence#Example ) is silently ignored..

Well not silentely, it will print 07-14 13:57:34:401 [ warning sync.csync ]: Local stat failed, errno 2

As mentioned above #5650 (comment) this might be better with 10.13..

(BTW, the same file works on a HFS+ sync dir)

@guruz
Copy link
Contributor Author

guruz commented Jul 14, 2017

@SamuAlfageme Do you have a Mac with High Sierra?

@guruz
Copy link
Contributor Author

guruz commented Jul 14, 2017

Same behaviour with 2.3.3 :[

The file gets silently ignored on an APFS volume but gets synced on a HFS+ volume (probably because there macOS normalizes..)

@guruz
Copy link
Contributor Author

guruz commented Jul 14, 2017

@michaelstingl This is something we need to investigate further and discuss if it is a blocker.

@guruz
Copy link
Contributor Author

guruz commented Jul 14, 2017

(I'm using 10.12.5..)

https://developer.apple.com/library/content/documentation/FileManagement/Conceptual/APFS_Guide/FAQ/FAQ.html

Runtime normalization will also be available in iOS 10.3.3 and macOS Sierra 10.12.6. Being normalization-insensitive ensures that normalization variants of a filename cannot be created in the same directory, and that a filename can be found with any of its normalization variants. This means that developers don’t need to do any additional work to ensure correct normalization behavior in these versions of macOS and iOS.

@michaelstingl
Copy link
Contributor

Yes, further investigation required. I've heard Apples API's/interfaces aren't final, could be easier when final release comes closer.

@guruz @SamuAlfageme What are the steps to verify/reproduce this?

@guruz
Copy link
Contributor Author

guruz commented Jul 14, 2017

@michaelstingl Ideally: To have a Mac with High Sierra (10.13) beta
(Maybe there is other ways, still investigating)

@michaelstingl
Copy link
Contributor

I will prepare a VM with High Sierra.

@guruz
Copy link
Contributor Author

guruz commented Jul 14, 2017 via email

@michaelstingl
Copy link
Contributor

michaelstingl commented Jul 14, 2017

My idea was to clone my existing Sierra VM, then update to High Sierra. I will keep an Snapshot, so I can revert whenever it's needed. I can also try a High Sierra clean install in another VM.

@michaelstingl
Copy link
Contributor

First step in the Updater asks if I want to upgrade my system volume to APFS:

michaels-i7-mac-mini_local_-_chrome_remote_desktop

Checkbox is disabled by default.

@michaelstingl
Copy link
Contributor

It seems migrating the volume which is in a VM image is very difficult. I wait all day and remaining time became bigger and bigger. (up to 10h 55m) Now, it starts to decrease. Let's see…

cursor_and_michaels-i7-mac-mini_local_-_chrome_remote_desktop

@guruz
Copy link
Contributor Author

guruz commented Jul 21, 2017

tested on High Sierra APFS VM with APFS, not case sensitive, not encrypted.

2.3.2/2.3.3 properly syncs the filename Amélie pasted from wikipedia.
master (with #5875) properly syncs the filename Amélie pasted from wikipedia.

master (with #5875) also properly syncs an emoji filename. (2.3 doesn't, it's a new feature of master)

The OS didn't let me create filenames with invalid utf8 (i think)

So I conclude APFS is fine with High Sierra, bad with Sierra which has APFS only for testing.
I'll close this issue on monday or so after we thought a bit more about this. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Discussion p2-high Escalation, on top of current planning, release blocker
Projects
None yet
Development

No branches or pull requests

4 participants