On Fri, 2024-11-15 at 21:42 +0100, наб wrote: > > On Sat, Nov 16, 2024 at 08:47:42AM +1300, Andrew Bartlett wrote: > > I've checked our code, if fallocate() fails, we write 32kb chunks. > It also looked like this to me but the falback path wasn't obvious. > (Also, 32k is kinda small IMO but whatever.) > > > But > > we won't control how glibc falls back if fallocate is not supported by > > the filesystem. > Sure, but since you're already implementing the fallback yourself, > you should probably use fallocate() instead of posix_fallocate(). > > Under glibc, > posix_fallocate() does fallocate(2) with the libc fallback if it fails, > fallocate() just does fallocate(2) and gives you the real error, > so error-detecting after the infallible posix_fallocate() is kinda moot. > > Under musl they're both equivalent to fallocate(2). > > So while "changing how glibc falls back" is definitely out of scope, > IMO "using a fallible interface to fall back from" could be in scope? > > This alone would drop the I/Os issued 8-fold, bumping the buffer > to something more reasonable in 2024 would make it even faster.
These points seem reasonable, but I don't work on Samba day to day any more (and not on the fileserver either), just still CC'ed on some bugs and figured I would look into it. The Samba bugzilla is the place to start a report that those who work in this area will see (but not act on with any priority, to be clear, due resourcing constraints) https://bugzilla.samba.org, but to have any change made to the codebase, I suggest opening a MR per https://wiki.samba.org/index.php/Contribute > > This isn't Samba, perhaps try libc6 or put the bug back to MHDDFS? > I find the belaboured exposition in glibc's posix_fallocate.c convincing, > but MHDDFS should implement fallocate regardless. That is the real answer. Thanks so much for your investigation and I wish you the best Andrew Bartlett -- Andrew Bartlett (he/him) https://samba.org/~abartlet/ Samba Team Member (since 2001) https://samba.org Samba Developer, Catalyst IT https://catalyst.net.nz/services/samba