Return of the magical disappearing files (OS X)

Status
Not open for further replies.

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
Let's start with a recap:

Some time ago, Adobe products were mysteriously deleting files when updating them on SMB shares:
https://forums.freenas.org/index.php?threads/deleting-psd-files-on-save.22080/

At the time, this was troubleshooted and considered a problem between Adobe products and OS X's handling of CIFS. OS X 10.6 and 10.9, as well as Photoshop CS5 and CS6.

Now, the plot thickens:
https://forums.freenas.org/index.ph...ne-datei-auf-freigabe-löscht-die-datei.24926/

For the benefit of the non-German speakers, here's what's going on:

@hok is experiencing the same thing, but with a different application: Word for Mac!
And guess what, one of the alternative applications he tried to replicate this in was Photoshop (dunno the version, though) and it worked (waiting for clarification if new or old files).

Problem occurs with CIFS on OS X 10.6, on two separate servers:

Gigabyte GA-MA770-UD3 Rev. 2.0 | Athlon II X2 235e 2,7GHz | 8 GB ECC-RAM
ZFS | 6x1TB RaidZ2 + 1x2TB + 2x3TB Mirror + 2x1TB

and

ASRock C2550D4I | 16 GB ECC-RAM
6 x WD Red 3 TB, ZFS - RaidZ2

FreeNAS 9.2.1.8 x64 in both cases.

Given that we can't just attribute this to "Ugh, Apple and Adobe? Sorry about that, pal..." anymore, I believe it's appropriate to discuss what the hell is going on.

I can imagine the following scenarios:

  1. Mysterious Samba bug
  2. Mysterious OS X bug
  3. Combination of 1. and 2. that produces a real bug where there was none
1. is hard to track, given Samba's update tendencies, 2. seems unlikely, 3. Sounds crazy hard to find.
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,553
Let's start with a recap:

Some time ago, Adobe products were mysteriously deleting files when updating them on SMB shares:
https://forums.freenas.org/index.php?threads/deleting-psd-files-on-save.22080/

At the time, this was troubleshooted and considered a problem between Adobe products and OS X's handling of CIFS. OS X 10.6 and 10.9, as well as Photoshop CS5 and CS6.

Now, the plot thickens:
https://forums.freenas.org/index.php?threads/Ändernder-macos-x-zugriff-auf-eine-datei-auf-freigabe-löscht-die-datei.24926/

For the benefit of the non-German speakers, here's what's going on:

@hok is experiencing the same thing, but with a different application: Word for Mac!
And guess what, one of the alternative applications he tried to replicate this in was Photoshop (dunno the version, though) and it worked (waiting for clarification if new or old files).

Problem occurs with CIFS on OS X 10.6, on two separate servers:

Gigabyte GA-MA770-UD3 Rev. 2.0 | Athlon II X2 235e 2,7GHz | 8 GB ECC-RAM
ZFS | 6x1TB RaidZ2 + 1x2TB + 2x3TB Mirror + 2x1TB

and

ASRock C2550D4I | 16 GB ECC-RAM
6 x WD Red 3 TB, ZFS - RaidZ2

FreeNAS 9.2.1.8 x64 in both cases.

Given that we can't just attribute this to "Ugh, Apple and Adobe? Sorry about that, pal..." anymore, I believe it's appropriate to discuss what the hell is going on.

I can imagine the following scenarios:

  1. Mysterious Samba bug
  2. Mysterious OS X bug
  3. Combination of 1. and 2. that produces a real bug where there was none
1. is hard to track, given Samba's update tendencies, 2. seems unlikely, 3. Sounds crazy hard to find.
It could be some sort of weird metadata operation that causes samba to barf on itself.

Macs like to store metadata as resource forks, which will get stored in xattrs on FreeNAS and are limited to something like 64KB. You can view what xattrs are being written by "lsextattr user <path to file>". If you see a "DosStream" xattr, then something is going on. You might also try unchecking the "write extended attributes" ACE through explorer in Windows.

If you want to narrow down the problem, you should increase Samba's logging to "debug" and reproduce the problem.

Edit: on the samba mailing lists I saw the following post: https://marc.info/?l=samba-technical&m=136572608331630&w=2
Hi folks,

In case anyone is interested, I am seeing really weird behavior from the Mac OS X clients (Including 10.7.5.

When saving a file in-place (not using Save As) PowerPoint for the Mac does the following:

1. Extend the file by some amount 512B at a time. Thus, there are 2048 SET_FILE_INFO requests to set EOF for each MB.
2. Write some amount of the file covered by the extend ...

When using Save As it does not do that. Saves are much faster.

I wonder if this is a problem with the Office suite or the Mac libraries. It seems that Photoshop saves have similar problems, so it might be a problem with Mac OS X libraries.
Of course, it wasn't followed up on.
 
Last edited:

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
@hok has updated with the following information:

Unlike with the original case, both new and old files are affected, but not always. The problem isn't constant across time and/or folders.

@anodos I'll pass on the suggestions, thanks for the help.
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,553
@hok has updated with the following information:

Unlike with the original case, both new and old files are affected, but not always. The problem isn't constant across time and/or folders.

@anodos I'll pass on the suggestions, thanks for the help.
It could be some sort of weird metadata operation that causes samba to barf on itself.

Macs like to store metadata as resource forks, which will get stored in xattrs on FreeNAS and are limited to something like 64KB. You can view what xattrs are being written by "lsextattr user <path to file>". If you see a "DosStream" xattr, then something is going on. You might also try unchecking the "write extended attributes" ACE through explorer in Windows.

If you want to narrow down the problem, you should increase Samba's logging to "debug" and reproduce the problem.

Edit: on the samba mailing lists I saw the following post: https://marc.info/?l=samba-technical&m=136572608331630&w=2

Of course, it wasn't followed up on.
Posting the smb4.conf file would also be helpful as its possible that there is a samba misconfiguration (you can never be sure what people do). :)
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
Posting the smb4.conf file would also be helpful as its possible that there is a samba misconfiguration (you can never be sure what people do). :)
@hok has provided the config file in the original thread and asks where he can find the Samba debug log.
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,553
@hok has provided the config file in the original thread and asks where he can find the Samba debug log.
The log is at /var/log/samba4/log.smbd
It will be large so use pastebin.

He has lots of shares. Does the problem appear across the board or only manifest in specific shares?

Have him post getfacl output for share where problem appears as well as a sample file.
 
Status
Not open for further replies.
Top