<html><head><style>pre,code,address {
margin: 0px;
}
h1,h2,h3,h4,h5,h6 {
margin-top: 0.2em;
margin-bottom: 0.2em;
}
ol,ul {
margin-top: 0em;
margin-bottom: 0em;
}
blockquote {
margin-top: 0em;
margin-bottom: 0em;
}
</style></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><div>This isn't Samba, perhaps try libc6 or put the bug back to MHDDFS?</div><div><br></div><div>I've checked our code, if fallocate() fails, we write 32kb chunks. But we won't control how glibc falls back if fallocate is not supported by the filesystem. </div><div><br></div><div>Andrew Bartlett</div><div><br></div><div>On Fri, 2024-11-15 at 17:39 +0100, наб wrote:</div><blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex"><pre>Control: retitle -1 smbd: please "strict allocate" smarter than 1 byte at a time</pre><pre><br></pre><pre>On Mon, Oct 15, 2018 at 10:40:58PM +0200, Marcél Ströhle wrote:</pre><blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex"><pre>When I initiate a samba share file transfer to a drive mounted through</pre><pre>MHDDFS, it takes many seconds to start writing, and I observe high MHDDFS</pre><pre>CPU usage. Reading a file works perfectly fine. Local writes are also fine.</pre><pre>The length of the delay seems to scale with the size of the file I want to</pre><pre>write.</pre></blockquote><pre><br></pre><pre>On Mon, Oct 15, 2018 at 11:57:26PM +0200, Marcél wrote:</pre><blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex"><pre>I must have overlooked one setting in Samba when I was trying to eliminate</pre><pre>its configuration as a source for this issue:</pre><pre>strict allocate = yes</pre><pre>This seems to be what caused the problem. Sorry for the falsely attributed</pre><pre>bug report, but maybe it's interesting information - I still think it's</pre><pre>weird that this only caused an issue with FUSE/MHDDFS, not the other share</pre><pre>I was using.</pre></blockquote><pre><br></pre><pre>I can repro this on samba bookworm, reassigning appropriately.</pre><pre>You only see this because syscalls to your other shares</pre><pre>are infinitely faster (at least 3-20 times) than MHDDFS.</pre><pre><br></pre><pre>On a Linux smbd mount, "truncate -s 100M 100M" by default (strict allocate = no)</pre><pre>just works and makes a sparse file.</pre><pre><br></pre><pre>With "strict allocate = yes", I see a busy-loop that looks like this</pre><pre> mhddfs [2024-11-15 17:17:55] (info): [139671981946560] mhdd_write: /100M, handle = 139671732492784, count = 1, offset = 104759295</pre><pre> mhddfs [2024-11-15 17:17:55] (info): [139671963047616] mhdd_write: /100M, handle = 139671732492784, count = 1, offset = 104763391</pre><pre> mhddfs [2024-11-15 17:17:55] (info): [139671972497088] mhdd_write: /100M, handle = 139671732492784, count = 1, offset = 104767487</pre><pre> mhddfs [2024-11-15 17:17:55] (info): [139671981946560] mhdd_write: /100M, handle = 139671732492784, count = 1, offset = 104771583</pre><pre> mhddfs [2024-11-15 17:17:55] (info): [139671963047616] mhdd_write: /100M, handle = 139671732492784, count = 1, offset = 104775679</pre><pre> mhddfs [2024-11-15 17:17:55] (info): [139671972497088] mhdd_write: /100M, handle = 139671732492784, count = 1, offset = 104779775</pre><pre> mhddfs [2024-11-15 17:17:55] (info): [139671981946560] mhdd_write: /100M, handle = 139671732492784, count = 1, offset = 104783871</pre><pre> mhddfs [2024-11-15 17:17:55] (info): [139671963047616] mhdd_write: /100M, handle = 139671732492784, count = 1, offset = 104787967</pre><pre> mhddfs [2024-11-15 17:17:55] (info): [139671972497088] mhdd_write: /100M, handle = 139671732492784, count = 1, offset = 104792063</pre><pre> mhddfs [2024-11-15 17:17:55] (info): [139671981946560] mhdd_write: /100M, handle = 139671732492784, count = 1, offset = 104796159</pre><pre> mhddfs [2024-11-15 17:17:55] (info): [139671963047616] mhdd_write: /100M, handle = 139671732492784, count = 1, offset = 104800255</pre><pre> mhddfs [2024-11-15 17:17:55] (info): [139671972497088] mhdd_write: /100M, handle = 139671732492784, count = 1, offset = 104804351</pre><pre> mhddfs [2024-11-15 17:17:55] (info): [139671981946560] mhdd_write: /100M, handle = 139671732492784, count = 1, offset = 104808447</pre><pre> mhddfs [2024-11-15 17:17:55] (info): [139671963047616] mhdd_write: /100M, handle = 139671732492784, count = 1, offset = 104812543</pre><pre> mhddfs [2024-11-15 17:17:55] (info): [139671972497088] mhdd_write: /100M, handle = 139671732492784, count = 1, offset = 104816639</pre><pre> mhddfs [2024-11-15 17:17:55] (info): [139671981946560] mhdd_write: /100M, handle = 139671732492784, count = 1, offset = 104820735</pre><pre> mhddfs [2024-11-15 17:17:55]: [139671972497088] mhdd_getxattr: path = /home/nabijaczleweli/uwu/mhddfs/100Mc/100M name = security.capability bufsize = 0</pre><pre> mhddfs [2024-11-15 17:17:55] (info): [139671963047616] mhdd_write: /100M, handle = 139671732492784, count = 1, offset = 104824831</pre><pre>instead.</pre><pre><br></pre><pre>And strace -fp "$(pgrep smbd)" shows</pre><pre> [pid 3565208] pwrite64(28, "\0", 1, 103092223) = 1</pre><pre> [pid 3565208] pwrite64(28, "\0", 1, 103096319) = 1</pre><pre> [pid 3565208] pwrite64(28, "\0", 1, 103100415) = 1</pre><pre> [pid 3565208] pwrite64(28, "\0", 1, 103104511) = 1</pre><pre> [pid 3565208] pwrite64(28, "\0", 1, 103108607) = 1</pre><pre> [pid 3565208] pwrite64(28, "\0", 1, 103112703) = 1</pre><pre> [pid 3565208] pwrite64(28, "\0", 1, 103116799) = 1</pre><pre> [pid 3565208] pwrite64(28, "\0", 1, 103120895) = 1</pre><pre> [pid 3565208] pwrite64(28, "\0", 1, 103124991) = 1</pre><pre> [pid 3565208] pwrite64(28, "\0", 1, 103129087) = 1</pre><pre> [pid 3565208] pwrite64(28, "\0", 1, 103133183) = 1</pre><pre> [pid 3565208] pwrite64(28, "\0", 1, 103137279) = 1</pre><pre> [pid 3565208] pwrite64(28, "\0", 1, 103141375) = 1</pre><pre> [pid 3565208] pwrite64(28, "\0", 1, 103145471) = 1</pre><pre> [pid 3565208] pwrite64(28, "\0", 1, 103149567) = 1</pre><pre> [pid 3565208] pwrite64(28, "\0", 1, 103153663) = 1</pre><pre> [pid 3565208] pwrite64(28, "\0", 1, 103157759) = 1</pre><pre> [pid 3565208] pwrite64(28, "\0", 1, 103161855) = 1</pre><pre> [pid 3565208] pwrite64(28, "\0", 1, 103165951) = 1</pre><pre> [pid 3565208] pwrite64(28, "\0", 1, 103170047) = 1</pre><pre> [pid 3565208] pwrite64(28, "\0", 1, 103174143) = 1</pre><pre> [pid 3565208] pwrite64(28, "\0", 1, 103178239) = 1</pre><pre> [pid 3565208] pwrite64(28, "\0", 1, 103182335) = 1</pre><pre> [pid 3565208] pwrite64(28, "\0", 1, 103186431) = 1</pre><pre> [pid 3565208] pwrite64(28, "\0", 1, 103190527) = 1</pre><pre> [pid 3565208] pwrite64(28, "\0", 1, 103194623) = 1</pre><pre> [pid 3565208] pwrite64(28, "\0", 1, 103198719) = 1</pre><pre> [pid 3565208] pwrite64(28, "\0", 1, 103202815) = 1</pre><pre> [pid 3565208] pwrite64(28, "\0", 1, 103206911) = 1</pre><pre> [pid 3565208] pwrite64(28, "\0", 1, 103211007) = 1</pre><pre> [pid 3565208] pwrite64(28, "\0", 1, 103215103) = 1</pre><pre> [pid 3565208] pwrite64(28, "\0", 1, 103219199) = 1</pre><pre> [pid 3565208] pwrite64(28, "\0", 1, 103223295) = 1</pre><pre> [pid 3565208] pwrite64(28, "\0", 1, 103227391) = 1</pre><pre> [pid 3565208] pwrite64(28, "\0", 1, 103231487) = 1</pre><pre> [pid 3565208] pwrite64(28, "\0", 1, 103235583) = 1</pre><pre> [pid 3565208] pwrite64(28, "\0", 1, 103239679) = 1</pre><pre> [pid 3565208] pwrite64(28, "\0", 1, 103243775) = 1</pre><pre> [pid 3565208] pwrite64(28, "\0", 1, 103247871) = 1</pre><pre> [pid 3565208] pwrite64(28, "\0", 1, 103251967) = 1</pre><pre> [pid 3565208] pwrite64(28, "\0", 1, 103256063) = 1</pre><pre> [pid 3565208] pwrite64(28, "\0", 1, 103260159) = 1</pre><pre><br></pre><pre>There /has/ to be some smarter way to do this.</pre></blockquote><div><br></div><div><span><pre>-- <br></pre><pre>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
</pre></span></div></body></html>