Bug 15324 - fruit:time machine max size can only be set to an integer and is ignored if user sets a float
Summary: fruit:time machine max size can only be set to an integer and is ignored if u...
Status: RESOLVED FIXED
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: VFS Modules (show other bugs)
Version: 4.16.8
Hardware: All All
: P5 critical with 10 votes (vote)
Target Milestone: ---
Assignee: Samba release manager
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-03-02 22:30 UTC by Mike Silva
Modified: 2026-10-23 15:38 UTC (History)
3 users (show)

See Also:


Attachments
patch from master for v4-25-test (9.03 KB, patch)
2026-10-12 05:40 UTC, Anoop C S
vl: review+
Details
patch from master for v4-24-test (9.10 KB, patch)
2026-10-12 05:41 UTC, Anoop C S
no flags Details
patch from master for v4-24-test (9.17 KB, patch)
2026-10-13 13:40 UTC, Anoop C S
vl: review+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Silva 2023-03-02 22:30:25 UTC
Description:
Time Machine Max Size can only be set to an integer, when a float value is a perfectly valid desired setting. Further, the documentation doesn't state that it only may be set to an integer. And, if the user sets it to a float, VFS fruit ignores the setting.

Perhaps related, is that setting Time Machine Max Size presumably should be in typical decimal storage units (e.g. megabytes, gigabytes, terabytes, etc), but seems to be being evaluated to be in binary units (e.g. mebibytes, gibibytes, tebibytes, etc)

Steps to Reproduce:
1) Setup a test samba share using vfs_fruit.
2) Set fruit:time machine max size = 2.2T on this share.
3) On a Mac, try to do a backup to the share created above. Note resulting Time Machine backup archive max storage.
4) Now, remove that share from your Mac.
5) On the Samba server, delete the contents of the share.
6) Change fruit:time machine max size = 2T for the share.
7) Restart the Samba server for the new max size setting to take effect.
8) On a Mac, try to do a backup to the share. Note resulting Time Machine storage limit. 

Expected Result

- For step 3 above, you would expect the available Time Machine storage for the share to be limited to 2.2T. Instead, the test shows it is the total storage of the filesystem hosting the share. (In my case 6T.) i.e. the time machine max size setting seems to be ignored

- For step 8 above, you would expect the available Time Machine storage for the share to be limited to 2T. Instead, the test result shows that the Mac sees the Time Machine storage limit as 2.2T, as though the 2 Terabytes the user intended to set the setting to, is being converted to 2.2 Tebibytes.

Discussion:
The unexpected result from test step 3 seems to occur because the value set for "Time Machine max size" is being converted from a char to a uint64. Even though, it's perfectly valid for a user to want to set a value like 2.5T as the Time Machine limit. Nor, does the manpage say that vfs_fruit only excepts whole numbers for the value...which would be a weird thing to do.

The unexpected result from test step 8 seems to occur because decimal storage units are being converted to binary. I've tried multiple values, and every time the result is exactly what you'd expect if this conversion was occurring.
Comment 1 Samba QA Contact 2026-10-11 16:07:04 UTC
This bug was referenced in samba master:

c617f334fb974e157d2a450b24cfcdd43f935b7b
Comment 2 Anoop C S 2026-10-12 05:40:30 UTC
Created attachment 19286 [details]
patch from master for v4-25-test
Comment 3 Anoop C S 2026-10-12 05:41:00 UTC
Created attachment 19287 [details]
patch from master for v4-24-test
Comment 4 Volker Lendecke 2026-10-12 08:02:30 UTC
Comment on attachment 19287 [details]
patch from master for v4-24-test

Can you add the cherry-picked-from tag?
Comment 5 Anoop C S 2026-10-13 13:40:12 UTC
Created attachment 19292 [details]
patch from master for v4-24-test
Comment 6 Anoop C S 2026-10-13 13:42:49 UTC
(In reply to Volker Lendecke from comment #4)
Oh, good eye. I may have deviated a bit while resolving the conflicts for v4-24-test. It's fixed now, thanks!
Comment 7 Samba QA Contact 2026-10-14 22:03:03 UTC
This bug was referenced in samba v4-25-test:

c09543f7501159ae1dc6e18a10ae2d95e014b8a8
Comment 8 Samba QA Contact 2026-10-22 19:11:04 UTC
This bug was referenced in samba v4-24-test:

b5f377e686fd1a39bf92b46a366d5ce129e3536c
Comment 9 Samba QA Contact 2026-10-23 15:38:10 UTC
This bug was referenced in samba v4-25-stable (Release samba-4.25.1):

c09543f7501159ae1dc6e18a10ae2d95e014b8a8