Date Modified not being copied on some subfolders (SMB/MacOS)

EMP-Tea

Dabbler
Joined
Jul 20, 2022
Messages
13
OS Version:
TrueNAS-13.0-U1.1 (Core)

Model:
TRUENAS-MINI-3.0-XL+

Memory:
32 GiB

8 bays filled with 4TB drives
Single ZFS pool in RAIDZ2
500GB SSD for mirrored boot pool

I've been chasing what seems to be an old bug that pops up in very specific test cases. It took me several days of trial and error to find a way of consistently reproducing this weird behavior. It might be related to the issue in this thread.

The issue:
When transferring files via SMB on MacOS (Mojave) to TrueNAS (13.0-U1.1), if a subfolder within the folder I am transferring contains enough files at roughly the right size, once the transfer is finished the Date Modified of the subfolder is set to the date it was transferred, and not the original Date Modified of the subfolder.

source.jpg

Notice the Date Modified of sub001 is incorrect.
destination.jpg

With some subfolders the Date Modified transfers correctly, but with certain others it consistently does not. I can reproduce this behavior using the following steps:

- Create a folder and a subfolder. Naming doesn't appear to affect anything. I named mine /test4/sub001/ in the images above.

- Place a png file roughly 300 KB in size (for some reason too small and too large doesn't always get the result). I have provided a testing png in a zip file that has gotten consistent results for me.

- Duplicate the image to above 500 copies. I simply did an Option + click'n'drag 9 times to get 512 copies of the same file. 256 copies did not get the result. Alternatively you can use the command mkfile 283k $(printf "%04d.png " {1..512}) to create 512 empty png files with size 283KB each.

- Optionally, you can change the date modified of the subfolder to something old to make it easier to identify. Or you can wait a minute for the current time to be noticeably different than the creation time of the folders. I used touch -t 201910291918 /Path/To/Source/Folder/sub001 to change the date of the subfolder to Oct 29 19:18:00 2019 in my example above.

- Then drag the parent folder (test4 in my case) to any directory or location on a TrueNAS SMB Share.

The result: the parent folder retains the Date Modified, the files retain the Date Modified, but the subfolder containing the files does not.

If you don't have enough files, the subfolder will have the correct Date Modified. If the files are too small, the date will be correct. But for some reason this sweet spot of files causes this issue. I've also encountered this with folders containing a handful of larger files (.mkv) in the 10s of GBs range. So it doesn't have to be png files in the subfolder.

Any ideas what's going on with this? Can anyone else reproduce this behavior? Or am I just that lucky? :P
 

Attachments

  • 0473.png.zip
    274.3 KB · Views: 107

FindingFilene

Dabbler
Joined
Nov 25, 2020
Messages
20
Something similar like this is happening to me with files I am uploading fresh to my NAS--file dates are stuck to whenever I've transferred them. It looks like this has been ongoing for a year, as well, and in the past year I've transitioned to TrueNAS Scale 13. I'm using a file transfer app for Android.
 
Last edited:
Top