In source3/smbd/service.c::close_cnum(), vfs_ChDir() is called after SMB_VFS_DISCONNECT(). This can cause the problem for other vfs modules. /* Call VFS disconnect hook */ SMB_VFS_DISCONNECT(conn); /* make sure we leave the directory available for unmount */ vfs_ChDir(conn, "/"); It appears https://git.samba.org/?p=samba.git;a=commitdiff;h=81464daea71e5fa3067ec7d5f5c69c890c0f7949 has fixed this issue in master. But it is not pushed to the V4-1 or other release branch. It is also questionable why we need to cache conn->cwd at all by calling vfs_GetWd() inside vfs_ChDir(), as we are going to free conn at the end of close_cnum() anyway.
Created attachment 10791 [details] git-am cherry-pick from master for 4.2.0, 4.1.next, 4.0.next. Applies cleanly to 4.1.next, 4.0.next. Just needs a +1 to be back-ported.
Comment on attachment 10791 [details] git-am cherry-pick from master for 4.2.0, 4.1.next, 4.0.next. Oh - also needs applying to 4.2.0 (or 4.2.1 if it's too late for the release).
Comment on attachment 10791 [details] git-am cherry-pick from master for 4.2.0, 4.1.next, 4.0.next. Michael/Ira, do we need this for 4.2.0 or will 4.2.1 be ok (apparently it affects the ceph VFS) ?
I'd prefer 4.2.0, just because shipping broken * is bad when we can avoid it. -Ira
Re-assigning to Karolin for inclusion in 4.2.0, 4.1.next, 4.0.next.
Pushed to autobuild-v4-[0|1|2]-test.
(In reply to Karolin Seeger from comment #6) Pushed to all branches. Closing out bug report. Thanks!