SMB2 AIO with unaligned memory address caused the read data corruption.

Jeremy Allison jra at samba.org
Wed Jun 13 15:20:33 UTC 2018


On Wed, Jun 13, 2018 at 10:10:36AM +0200, Volker Lendecke wrote:
> On Mon, Jun 11, 2018 at 12:21:57PM -0700, Partha Sarathi via samba-technical wrote:
> > We recently come across a read data corruption issue using samba.4.7.x
> > against *Linux Fuse FS with DIO enabled*.
> > 
> > We nailed down the issue was an outcome of samba AIO preads were reusing
> > the unaligned buffer address allocated by *talloc* library.  The kernel
> > FUSE with DIO path (Direct IO) was not handling the unaligned memory
> > correctly.  We are trying to fix this issue from both the ends.
> 
> As Jeremy wrote, there must be something non-obvious to us going on.
> Maybe you want to post your complete Samba source code somewhere.  To
> the best of our knowledge, pread/pwrite don't have alignment
> requirements, and that is what we're using.
> 
> If you have more direct access into fuse using other calls, things
> might be different. This would be highly interesting, as many
> fuse-based Samba servers suffer from bad performance. If you have
> tweaks there that could help us, we'd appreciate those patches.

FYI, I communicated privately with Partha. It's an issue with
their custom fuse module - all pread/pwrite calls to it will
fail if not aligned. This will break much more than Samba of
course. They're going to fix it :-).

Jeremy.



More information about the samba-technical mailing list