Nested filesystem exports with AFP

Status
Not open for further replies.

gdreade

Dabbler
Joined
Mar 11, 2015
Messages
34
Here's an entry for the Really Weird Sh*t category.

I had a situation with 9.3-STABLE where I had two nested filesystems: /mnt/pool1/first and /mnt/pool1/first/second. I set up an AFP share for /mnt/pool1/first as volume "First". On the client end (Yosemite), I was able to access both "/Volumes/First" and "/Volumes/First/second" as one mount. (I was expecting to have to set up an AFP export and a corresponding mount for both, but *shrug*.)

Then I proceeded to run tests.

I found out that when I was generating a large directory hierarchy on *second, the application would error out in rather unexpected ways: It would complain that some things that should be directories were regular files and vice versa. (But not all of them; just some.) Exiting the application and looking at the filesystem on the client (via the shell) showed the weirdness as well; it wasn't just the application.

So I look on the FreeNAS box using the shell. Everything is as expected: Things that should be directories are directories, and things that should be files are files. At least that much is ok (ie: no underlying data corruption).

Restarting the AFP server or rebooting the client makes things look sane again, but before long similar problems are observed (not necessarily with the same files). After playing and flailing a while, I changed things around such that the filesystems were *not* hierarchical: /mnt/pool1/first and /mnt/pool1/second, using two exports on the AFP server side and two mounts on the client side. Now things seem to be sane.

I'm wondering if there was an inconsistency with FSIDs (ie: cache effects and duplicate inode numbers on different filesystems messing things up), but I don't have any data to support it either way.

Theories are solicited.

#define ASIDE
Some people comment that AFP is being deprecated. Others report that SMB on OS-X sucks. Apple's been making it harder to do NFS mounts. It would sure be nice if there was *some* enterprise network filesystem for OS-X that both worked now and looked like it would be supported going forward. And that cloud crap doesn't count. Iterop seems to be taking a nose-dive ...
#undef ASIDE
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,525
I don't have anything to add except that I'll throw my hands in the air and say "what the fsck?!"

That some seriously bizarre behavior. I don't own any Apple products in my house, so I can't tell you what is going on.

You are correct though. OSX is in this really crappy tiny corner with no good "out" to the file server world from my perspective. It's a damned if you do and damned if you don't scenario.
 

Dennis.kulmosen

Explorer
Joined
Aug 13, 2013
Messages
96
You have experienced one of the reasons to why Apple is ditching AFP. Nested shares will silently corrupt the AFP metadatabase, thereby rendering all kind of issues.
AFP keeps track of all the metadata in a database. Location of files and folders. That database is independent of the underlaying filesystem. So when you make changes in "second" the database in "first" tries to update both "second" and "first" but at the same time the database in "second" are also updating.
OSX seems to be in a transition mode where AFP is kind of depricated, but its SMB implementation is only okey for consumers. A lot of people are hoping for some kind of usefull solution, wether it be samba support for OSX or OSX support for real SMB. [emoji4]
We only have to wait and see.
In an Mac only environment i would still prefer AFP for now.
 
Status
Not open for further replies.
Top