Bug 281360 (net/samba419_time_machine_posix_rename) - net/samba419 breaks fruit:posix_rename which is required for Time Machine
Summary: net/samba419 breaks fruit:posix_rename which is required for Time Machine
Status: Closed FIXED
Alias: net/samba419_time_machine_posix_rename
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: FreeBSD Samba Team
URL:
Keywords:
Depends on:
Blocks: DEFAULT_VERSIONS=samba=4.19 deprecate_samba416
  Show dependency treegraph
 
Reported: 2024-09-08 11:49 UTC by David Chisnall
Modified: 2025-02-07 18:45 UTC (History)
8 users (show)

See Also:
bugzilla: maintainer-feedback? (samba)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Chisnall freebsd_committer freebsd_triage 2024-09-08 11:49:06 UTC
Shares exported with samba 4.19 with `fruit:posix_rename = yes` set do not permit directories to be renamed.  With the net/samba416 port, this worked correctly.  From a macOS machine that has mounted the share, the following set of commands demonstrates the problem:

```
$ mkdir tmp
$ touch tmp/foo
$ mv tmp fmp
mv: rename tmp to fmp: Operation not supported
```

With Samba 4.16, this worked correctly.
Comment 1 Craig Leres freebsd_committer freebsd_triage 2024-09-08 21:50:32 UTC
Nice catch! But I found an even simpler failure case:

    m2 46 % touch frob
    m2 47 % rm frob
    rm: frob: Operation not supported

Here are a few lines from the samba log:

[2024/09/08 14:44:51.134796,  3] ../../source3/smbd/dir.c:803(smbd_dirptr_get_entry)
  smbd_dirptr_get_entry: mask=[frob] found frob fname=frob (frob)
[2024/09/08 14:44:51.134856,  2] ../../source3/lib/adouble.c:2153(ad_read_meta)
  error reading meta xattr: Operation not supported
  facl(ACE_GETACLCNT, frob): Function not implemented unix_mode(frob) inherit mode 40755
  facl(ACE_GETACLCNT, frob): Function not implemented tester opened file frob read=No write=No (numopen=4)

I browsed upstream bug reports but don't see this, maybe it would be a good idea to open one?
Comment 2 Craig Leres freebsd_committer freebsd_triage 2024-09-09 20:43:50 UTC
I've tested the 4.19.7 -> 4.19.8 update and it provides no improvement to this issue.

m2 103 % touch abc
m2 104 % rm abc
rm: abc: Operation not supported
Comment 3 commit-hook freebsd_committer freebsd_triage 2024-09-10 15:09:05 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=550e0299804acaa7d73f6744c14b0e0f1a598d9c

commit 550e0299804acaa7d73f6744c14b0e0f1a598d9c
Author:     Mateusz Piotrowski <0mp@FreeBSD.org>
AuthorDate: 2024-09-10 15:01:20 +0000
Commit:     Mateusz Piotrowski <0mp@FreeBSD.org>
CommitDate: 2024-09-10 15:07:16 +0000

    Mk/bsd.default-versions.mk: Revert the SAMBA default from 4.19 back to 4.16

    This reverts commit 0d1aba712a301ddb1e8b7ccbf3acc721dc3c90e8.

    A recently reported bug 281360 might suggests that Samba 4.19 does not
    work with Time Machine and might result in data loss.

    Let's revert the default version bump for now until we have more time to
    plan how we are going to deal with issue. A potential solution would be
    to disable Time Machine support in 4.19 for now.

    PR:             280769 281360
    Reported by:    theraven
    Approved by:    samba (0mp)

 Mk/bsd.default-versions.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Comment 4 Marko Cupać 2024-09-19 09:56:52 UTC
This is terrible. Bouncing everyone's default versions willy-nilly back and forth because two people have problem with their corner case.

You could have set lower default versions in make.conf for yourselves.
Comment 5 David Chisnall freebsd_committer freebsd_triage 2024-09-19 09:59:57 UTC
(In reply to Marko Cupać from comment #4)

Do you have evidence that only two people had problems?  The latest issue of the FreeBSD Journal had an article that described how to set up Samba with *precisely* the affected use case, so I would strongly suspect that it's more than two people.

As far as I am aware `make.conf` is not read by `pkg`, so I don't think that's a helpful suggestion.

Do you have constructive suggestions or did you just come here to add noise and insult people?
Comment 6 Mateusz Piotrowski freebsd_committer freebsd_triage 2024-09-19 10:08:34 UTC
(In reply to Marko Cupać from comment #4)

I did what I deemed necessary to avoid data loss for the users who use FreeBSD as a reliable storage for their Time Machine backups. As far as I know, this is the standard procedure for rolling back updates to DEFAULT_VERSION which turn out to need more baking time (e.g., a78ac4eb9990a0c44bf11bdb522cbe7a3bf3ad45).

If you believe that 4.19 is ready to be the default version, please post your testing results to https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=280769. Extra data points from the community let us have more confidence in the updates when we commit them.
Comment 7 Marko Cupać 2024-09-19 10:25:22 UTC
Guys, thanks for maintaining samba on FreeBSD. I got much more from it than I paid for. However, I think this unpleasant situation could have been avoided with a little more internal testing before commiting to HEAD.

Best regards,
Comment 8 Craig Leres freebsd_committer freebsd_triage 2024-10-23 04:46:24 UTC
Any chance the update of samba419 to 4.19.9 solves this? I'm not in a position to test the new version until tomorrow.

https://cgit.freebsd.org/ports/commit/?id=f8c19ed2ce9ab4d724a3309fc6ed4cdf78b10716
Comment 9 Craig Leres freebsd_committer freebsd_triage 2024-10-23 18:13:51 UTC
(In reply to Craig Leres from comment #8)
Survey says not:

    m2 3 % cd /Volumes/Time\ Machine/
    m2 12 % touch adf
    m2 13 % ls -l
    total 17
    -rw-r--r--  1 leres  staff      0 Oct 23 11:05 adf
    drwxr-xr-x  1 leres  staff  16384 Oct 23 10:15 m2.sparsebundle
    m2 14 % rm adf 
    rm: adf: Operation not supported

I'm going to file a bugzilla.samba.org issue (but the procedure for getting an account there is quite baroque so I'm slogging through that process...)
Comment 10 Craig Leres freebsd_committer freebsd_triage 2024-10-23 20:39:22 UTC
Upstream bug report submitted:

    https://bugzilla.samba.org/show_bug.cgi?id=15744
Comment 11 Vladimir Druzenko freebsd_committer freebsd_triage 2025-01-13 11:14:30 UTC
Probably fixed with this commit: https://cgit.FreeBSD.org/ports/commit/?id=24fbb52094816ac737d04a668f32dbaf471b41e8
Comment 12 Craig Leres freebsd_committer freebsd_triage 2025-01-13 17:54:04 UTC
(In reply to Vladimir Druzenko from comment #11)
Can confirm! Both the quick test and an actual backup. 14.2/amd64 vs. 15.2-Sequoia/M4.

m4 10 # cd /Volumes/com.apple.TimeMachine.localsnapshots
m4 11 # ls -lts
total 0
0 drwxr-xr-x  3 root  wheel  96 Jan 12 21:48 Backups.backupdb
m4 12 # touch foofof
m4 13 # rm foofof
m4 14 # ls -tsl
total 0
0 drwxr-xr-x  3 root  wheel  96 Jan 12 21:48 Backups.backupdb
m4 15 #
Comment 13 Craig Leres freebsd_committer freebsd_triage 2025-01-13 18:01:33 UTC
(I tested with 4.19.9_4)
Comment 14 Vladimir Druzenko freebsd_committer freebsd_triage 2025-01-13 18:17:55 UTC
Close?
Comment 15 Mateusz Piotrowski freebsd_committer freebsd_triage 2025-02-06 15:39:46 UTC
(In reply to Vladimir Druzenko from comment #14)

Could you confirm that this is not an issue on the current version of 4.20 as well?
Comment 16 Vladimir Druzenko freebsd_committer freebsd_triage 2025-02-06 16:05:57 UTC
(In reply to Mateusz Piotrowski from comment #15)
I don't use this feature. I judge by the comments.
Comment 17 David Chisnall freebsd_committer freebsd_triage 2025-02-06 16:11:01 UTC
(In reply to Vladimir Druzenko from comment #16)

I've just tested 4.19 and 4.20.

On 4.19, I can complete a Time Machine backup.  Yay, thank you everyone who made this work!

On 4.20, I can't even connect to the server from macOS, with or without Time Machine.  Not sure what's happening there but the 4.20 package seems to be completely broken.   Nothing informative in log.smbd.
Comment 18 Mateusz Piotrowski freebsd_committer freebsd_triage 2025-02-06 17:16:36 UTC
(In reply to David Chisnall from comment #17)

Yes, I'm sorry about the breakage with Samba 4.20. I didn't notice wrong package names in *_DEPENDS during review. A patch for that has landed so 4.20 should be installable soon.

Thank you for testing 4.19!

I'm closing this ticket. Let's reopen it/open a new one if it's still a problem on 4.20.
Comment 19 Craig Leres freebsd_committer freebsd_triage 2025-02-07 01:34:57 UTC
(In reply to David Chisnall from comment #17)
By coincidence I tried to upgrade from 4.19 to 4.20 yesterday and was also completely unable to connect from my mac.
Comment 20 Mateusz Piotrowski freebsd_committer freebsd_triage 2025-02-07 09:40:00 UTC
(In reply to Craig Leres from comment #19)
Could it be a different bug?
Comment 21 Xavier Beaudouin freebsd_committer freebsd_triage 2025-02-07 10:05:41 UTC
Seems on net/samba420 that : https://cgit.freebsd.org/ports/commit/?id=24fbb52094816ac737d04a668f32dbaf471b41e8 is not available on this port...

Maybe we can try to add this patch into samba 4.20 ?
Comment 22 Craig Leres freebsd_committer freebsd_triage 2025-02-07 18:45:38 UTC
(In reply to Mateusz Piotrowski from comment #20)
Seems like it; with samba420 I can't even get my mac mini to mount the samba volume. When samba419 was broken I could mount and create files (but could not rename them).

(In reply to Xavier Beaudouin from comment #21)
I think that patch is already in the samba420 port:

    files/0100-Fix-pathref-handling-for-FreeBSD-13plus_samba42x.patch