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: Open
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: 2024-10-23 20:39 UTC (History)
5 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