openzfsonwindows / openzfs

OpenZFS on Linux and FreeBSD
https://openzfs.github.io/openzfs-docs
Other
402 stars 15 forks source link

Renaming a shared file from a Mac O/S device creates an unusable file #387

Open artbatista opened 1 week ago

artbatista commented 1 week ago

Distribution Name | Windows 10 Pro Distribution Version | 21H1 Kernel Version | 19043.1081 Architecture |Windows 10 Pro version 21H1 OpenZFS Version | zfs-windows-2.2.3-rc5

I have a ZFS pool shared via SMB. With a windows client, I can rename files in a shared pool.

However, if I rename files from a Mac OS device, I get a funny looking directory entry, an unopenable file.

This file, can be moved, but can’t be opened, or deleted.

I have run scrub multiple times, no errors are shown.

Please see attached screen captures.

IMG_0126 IMG_0127

lundman commented 1 week ago

Ah most interesting - I am probably missing the rename call they use in SMB, there are a few after all. If you feel up to it, run "FileSpy" by Ladislav aimed at the ZFS drive letter to see what API it calls when you rename. But I'll get to checking it at some point.

lundman commented 1 week ago

Wait uh.. So ZFS is on Windows, and shared over SMB, to macOS as a client, that renames the file?

artbatista commented 1 week ago

Correct. The above happened while transcoding the files. The app that does it, creates a temporary file in a local (Mac) drive, when it’s done transcoding it copies the temp file to the same directory (zfs) as the original, once that is done it deletes the original and renames the new file. It’s at that point that the funky long filename appears and the file becomes unusable.

I then did it manually from the finder app on my Mac. Basically, copied a file over to the shared zfs directory, ok so far. Renamed the file from finder and the above is the result.

When I get home from work, I’ll run filespy. Will let you know.

lundman commented 6 days ago

So everything worked well here, created E: pool, folder named "tools", on Windows 11. Then shared. Connected with smb:// from mac (Sonoma), and renamed pippin.jpg.

You are working on Z: the pool, are there any dataset reparse mounts involved? Are "Crap" or "War & Remembrance" datasets or plain folders?

Screenshot 2024-06-27 at 8 43 59 (2)
artbatista commented 6 days ago

Those directories were originally in Z:\Ended TV, but after these duds were created, they caused Plex to see them while being unable to serve the files.

I created the CRAP directories to get them out of the way of Plex and was able to move them there.

I have been very busy lately, but in a day or two I’ll repeat the experiment and see what happens.

This has happened with this transcoding app (TDARR) as well as manually by renaming a file in Z: root manually from my Mac (latest Sonoma).

I am a bit puzzled why this is happening.

artbatista commented 6 days ago

They are plain folders under Z:\ which is just the default pool mount point.