Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 14 Mar 2020 12:56:45 +1100
From:      Andrew Reilly <areilly@bigpond.net.au>
To:        Matt Garber <matt.garber@gmail.com>
Cc:        freebsd-stable@freebsd.org, Theron <theron.tarigo@gmail.com>, rb@gid.co.uk, chris@theory14.net
Subject:   Re: Long-shot: repeatable macOS samba share unmounting during Lightroom import
Message-ID:  <FFB209C5-36CE-4C2B-985F-6807F9910B8B@bigpond.net.au>
In-Reply-To: <CANwXMPN7aN1um2GKsccEU_PQ%2BK92fD=CFSJ%2BU7%2BTpKx5FdO74Q@mail.gmail.com>
References:  <28504691-D08B-483B-B4C5-CA47F2C523ED@bigpond.net.au> <CANwXMPN7aN1um2GKsccEU_PQ%2BK92fD=CFSJ%2BU7%2BTpKx5FdO74Q@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
HI again,

You might remember my Samba-related cry for help, last November.  I'm =
writing again to report that the problem has been resolved on my =
systems, as near as I can tell.  Perhaps my experience will help others.

The "fix" has come as a result of some changes to my filesystem =
structure that I made as a result of a recent drive replacement (the =
1.8T of photos from my last trip ran me out of storage).  The upshot of =
that is that I don't know whether my previous troubles were =
misconfiguration on my part, or some sort of subtle bug in any of the =
players at the table: Samba on FreeBSD on ZFS or macOS Catalina's smbfs. =
 After some experimentation I was able to conclude that Lightroom itself =
was unlikely to be the root problem: failure was easily repeatable with =
a find in a macOS terminal session.

Quick summary of the problem: macOS Catalina would silently and =
seemingly-spontaneously disconnect from my Samba filesystems, exported =
from my FreeBSD-12-STABLE server when doing any activity that listed or =
stat-ed all of the files in a directory of some thousands.  To make =
matters worse, before the macOS 10.15.3 release, this disconnection =
would leave the smbfs driver, or some other macOS kernel state broken, =
and it would not be possible to re-mount or properly eject the failed =
mount without a reboot.  Since I was rebooting a lot, Apple were getting =
a lot of crash dumps from me, and their 10.15.3 release seems to have =
fixed whatever was stuck in the kernel - reboots were no longer required =
- but the disconnection problem persisted.

I have a couple of users on the file server, with the usual home =
directories in /home/<uname> and these were exported using Samba's =
[homes] configuration stanza, in the usual fashion.  I also had a shared =
directory, at /home/us, which was exported by a separate Samba stanza =
with an explicit path =3D /home/us, because "us" isn't a user.

When the drives filled up and I installed a new set, since I was going =
to restore from backups I took the opportunity to create a new zfs file =
system for "us" (/tank/us), and tweaked the smb4.conf accordingly.

That seems to have returned the file systems/server/macOS combination to =
robust good health.  I have not experienced a spontaneous-unmount since =
that change, and nothing else about the configuration has changed.

My guess: SMB2 enhanced security rules, which Samba enforces, insist =
that each host can only log-in/mount a given share once: any secondary =
mount attempt should cause the server to drop all mounts.  (Sorry, I =
can't remember which reference site pointed that out to me.)  Perhaps =
Samba is interpreting the rule on the basis of underlying host-side =
filesystem structure?  That would put the old /home/us and /home/uname =
shares on the same filesystem, and trigger the security rule?  Well, I =
always had both "mounted", but perhaps there was a particular pattern of =
heavy or slow access that triggered something?  Anyway, having all of =
the filesystems exported by Samba coming from unique zfs filesystems on =
the FreeBSD side has made everything happy.  Yay?

FWIW I'm running the latest Samba-4.10.13 from ports on FreeBSD =
12.1-STABLE r358963 GENERIC  amd64 on a AMD Ryzen 7 1700 Eight-Core =
Processor with hardware threads turned on.

By the way, the current Samba stable release is 4.12.0 (one week old) =
and 4.11.0 was released last September.  Is there some particular =
incompatibility with FreeBSD that is keeping these out of Ports?  I got =
quite close to trying to build the newer version myself, but then the =
problem went away...

Cheers,

Andrew Reilly
M: 0409-824-272
areilly@bigpond.net.au



> On 24 Nov 2019, at 13:46 , Matt Garber <matt.garber@gmail.com> wrote:
>=20
> On Sat, Nov 23, 2019 at 9:34 PM Andrew Reilly <areilly@bigpond.net.au =
<mailto:areilly@bigpond.net.au>> wrote:
>=20
> The other protagonist in this tale, also connected to the gigabit
> LAN, is an iMac running current-Catalina on APFS flash, mounting
> three filesystems over SMB, from Samba 4.10.10.  After appropriate
> Samba tweaking this seems to be at least as reliable as it ever was
> with netatalk or NFS, and apparently better supported by Apple.
>=20
> Considering all of the other bugs and instability introduced (or =
reintroduced) in Catalina: did you have this same Lightroom import =
workflow configured in Mojave (or whichever other previous macOS version =
you were using), and if so, were you encountering the same issue?
>=20
>=20
> Thanks,
> =E2=80=94
> Matt Garber
>=20




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?FFB209C5-36CE-4C2B-985F-6807F9910B8B>