[Pkg-samba-maint] Bug#911118: mhddfs hangs for a while on writing

Andrew Bartlett abartlet at samba.org
Fri Nov 15 19:47:42 GMT 2024


This isn't Samba, perhaps try libc6 or put the bug back to MHDDFS?

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. 

Andrew Bartlett

On Fri, 2024-11-15 at 17:39 +0100, наб wrote:
> Control: retitle -1 smbd: please "strict allocate" smarter than 1 byte at a time
> 
> On Mon, Oct 15, 2018 at 10:40:58PM +0200, Marcél Ströhle wrote:
> > When I initiate a samba share file transfer to a drive mounted through
> > MHDDFS, it takes many seconds to start writing, and I observe high MHDDFS
> > CPU usage. Reading a file works perfectly fine. Local writes are also fine.
> > The length of the delay seems to scale with the size of the file I want to
> > write.
> 
> On Mon, Oct 15, 2018 at 11:57:26PM +0200, Marcél wrote:
> > I must have overlooked one setting in Samba when I was trying to eliminate
> > its configuration as a source for this issue:
> > strict allocate = yes
> > This seems to be what caused the problem. Sorry for the falsely attributed
> > bug report, but maybe it's interesting information - I still think it's
> > weird that this only caused an issue with FUSE/MHDDFS, not the other share
> > I was using.
> 
> I can repro this on samba bookworm, reassigning appropriately.
> You only see this because syscalls to your other shares
> are infinitely faster (at least 3-20 times) than MHDDFS.
> 
> On a Linux smbd mount, "truncate -s 100M 100M" by default (strict allocate = no)
> just works and makes a sparse file.
> 
> With "strict allocate = yes", I see a busy-loop that looks like this
>   mhddfs [2024-11-15 17:17:55] (info): [139671981946560] mhdd_write: /100M, handle = 139671732492784, count = 1, offset = 104759295
>   mhddfs [2024-11-15 17:17:55] (info): [139671963047616] mhdd_write: /100M, handle = 139671732492784, count = 1, offset = 104763391
>   mhddfs [2024-11-15 17:17:55] (info): [139671972497088] mhdd_write: /100M, handle = 139671732492784, count = 1, offset = 104767487
>   mhddfs [2024-11-15 17:17:55] (info): [139671981946560] mhdd_write: /100M, handle = 139671732492784, count = 1, offset = 104771583
>   mhddfs [2024-11-15 17:17:55] (info): [139671963047616] mhdd_write: /100M, handle = 139671732492784, count = 1, offset = 104775679
>   mhddfs [2024-11-15 17:17:55] (info): [139671972497088] mhdd_write: /100M, handle = 139671732492784, count = 1, offset = 104779775
>   mhddfs [2024-11-15 17:17:55] (info): [139671981946560] mhdd_write: /100M, handle = 139671732492784, count = 1, offset = 104783871
>   mhddfs [2024-11-15 17:17:55] (info): [139671963047616] mhdd_write: /100M, handle = 139671732492784, count = 1, offset = 104787967
>   mhddfs [2024-11-15 17:17:55] (info): [139671972497088] mhdd_write: /100M, handle = 139671732492784, count = 1, offset = 104792063
>   mhddfs [2024-11-15 17:17:55] (info): [139671981946560] mhdd_write: /100M, handle = 139671732492784, count = 1, offset = 104796159
>   mhddfs [2024-11-15 17:17:55] (info): [139671963047616] mhdd_write: /100M, handle = 139671732492784, count = 1, offset = 104800255
>   mhddfs [2024-11-15 17:17:55] (info): [139671972497088] mhdd_write: /100M, handle = 139671732492784, count = 1, offset = 104804351
>   mhddfs [2024-11-15 17:17:55] (info): [139671981946560] mhdd_write: /100M, handle = 139671732492784, count = 1, offset = 104808447
>   mhddfs [2024-11-15 17:17:55] (info): [139671963047616] mhdd_write: /100M, handle = 139671732492784, count = 1, offset = 104812543
>   mhddfs [2024-11-15 17:17:55] (info): [139671972497088] mhdd_write: /100M, handle = 139671732492784, count = 1, offset = 104816639
>   mhddfs [2024-11-15 17:17:55] (info): [139671981946560] mhdd_write: /100M, handle = 139671732492784, count = 1, offset = 104820735
>   mhddfs [2024-11-15 17:17:55]: [139671972497088] mhdd_getxattr: path = /home/nabijaczleweli/uwu/mhddfs/100Mc/100M name = security.capability bufsize = 0
>   mhddfs [2024-11-15 17:17:55] (info): [139671963047616] mhdd_write: /100M, handle = 139671732492784, count = 1, offset = 104824831
> instead.
> 
> And strace -fp "$(pgrep smbd)" shows
>   [pid 3565208] pwrite64(28, "\0", 1, 103092223) = 1
>   [pid 3565208] pwrite64(28, "\0", 1, 103096319) = 1
>   [pid 3565208] pwrite64(28, "\0", 1, 103100415) = 1
>   [pid 3565208] pwrite64(28, "\0", 1, 103104511) = 1
>   [pid 3565208] pwrite64(28, "\0", 1, 103108607) = 1
>   [pid 3565208] pwrite64(28, "\0", 1, 103112703) = 1
>   [pid 3565208] pwrite64(28, "\0", 1, 103116799) = 1
>   [pid 3565208] pwrite64(28, "\0", 1, 103120895) = 1
>   [pid 3565208] pwrite64(28, "\0", 1, 103124991) = 1
>   [pid 3565208] pwrite64(28, "\0", 1, 103129087) = 1
>   [pid 3565208] pwrite64(28, "\0", 1, 103133183) = 1
>   [pid 3565208] pwrite64(28, "\0", 1, 103137279) = 1
>   [pid 3565208] pwrite64(28, "\0", 1, 103141375) = 1
>   [pid 3565208] pwrite64(28, "\0", 1, 103145471) = 1
>   [pid 3565208] pwrite64(28, "\0", 1, 103149567) = 1
>   [pid 3565208] pwrite64(28, "\0", 1, 103153663) = 1
>   [pid 3565208] pwrite64(28, "\0", 1, 103157759) = 1
>   [pid 3565208] pwrite64(28, "\0", 1, 103161855) = 1
>   [pid 3565208] pwrite64(28, "\0", 1, 103165951) = 1
>   [pid 3565208] pwrite64(28, "\0", 1, 103170047) = 1
>   [pid 3565208] pwrite64(28, "\0", 1, 103174143) = 1
>   [pid 3565208] pwrite64(28, "\0", 1, 103178239) = 1
>   [pid 3565208] pwrite64(28, "\0", 1, 103182335) = 1
>   [pid 3565208] pwrite64(28, "\0", 1, 103186431) = 1
>   [pid 3565208] pwrite64(28, "\0", 1, 103190527) = 1
>   [pid 3565208] pwrite64(28, "\0", 1, 103194623) = 1
>   [pid 3565208] pwrite64(28, "\0", 1, 103198719) = 1
>   [pid 3565208] pwrite64(28, "\0", 1, 103202815) = 1
>   [pid 3565208] pwrite64(28, "\0", 1, 103206911) = 1
>   [pid 3565208] pwrite64(28, "\0", 1, 103211007) = 1
>   [pid 3565208] pwrite64(28, "\0", 1, 103215103) = 1
>   [pid 3565208] pwrite64(28, "\0", 1, 103219199) = 1
>   [pid 3565208] pwrite64(28, "\0", 1, 103223295) = 1
>   [pid 3565208] pwrite64(28, "\0", 1, 103227391) = 1
>   [pid 3565208] pwrite64(28, "\0", 1, 103231487) = 1
>   [pid 3565208] pwrite64(28, "\0", 1, 103235583) = 1
>   [pid 3565208] pwrite64(28, "\0", 1, 103239679) = 1
>   [pid 3565208] pwrite64(28, "\0", 1, 103243775) = 1
>   [pid 3565208] pwrite64(28, "\0", 1, 103247871) = 1
>   [pid 3565208] pwrite64(28, "\0", 1, 103251967) = 1
>   [pid 3565208] pwrite64(28, "\0", 1, 103256063) = 1
>   [pid 3565208] pwrite64(28, "\0", 1, 103260159) = 1
> 
> There /has/ to be some smarter way to do this.

-- 
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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-samba-maint/attachments/20241116/5ef95180/attachment-0001.htm>


More information about the Pkg-samba-maint mailing list