[Samba] io_uring cause data corruption

Jeremy Allison jra at samba.org
Tue Apr 28 00:00:47 UTC 2020


On Mon, Apr 27, 2020 at 04:52:44PM -0700, Jeremy Allison via samba wrote:
> > Test 1)
> > Copy 10 10GB files.
> > 1) ddrescue -s 10G -v -f /dev/urandom 0.bin
> 
> Rather than using /dev/urandom can you use a
> constant (non-zero) byte value ? That way we can spot
> the first position where it changes in the file.
> 
> > 2) for((i=1;i<=10;i+=1)); do cp --reflink=always 0.bin $i.bin; done
> > 3) sha256sum *.bin > sha256sum.txt
> > 4) Windows 10, file explorer, copy the 10 files to a local disk D:\test\
> > 5) Verify local files in D:\test with sha256sum
> > 6) sha256sum was correct.
> > 7) redid step 4 and 5. Now sha256sum was wrong, but all 10 files had the
> > same (but wrong) csum!
> 
> The io_uring module has a vfs_io_uring:num_entries parameter
> which by default is set to 128. The readv/writev requests are
> queued inside smbd, but the number of outstanding io_uring
> requests are set by io_uring_queue_init(vfs_io_uring:num_entries,...).
> Can you try changing that value to see if the corruption point
> moves ?
> 
> There is also a setting vfs_io_uring:sqpoll, currently set
> to false. Try flipping that to true to see if it changes
> the problem.

Another thing I'd suggest is to copy the files using
smbclient to another (or the same) Linux box. Eliminate
the Windows SMB2 client here. See if it still gives
corruption.



More information about the samba mailing list