[PATCH] Re: s3: smb2 read sendfile

Michael Adam obnox at samba.org
Tue Oct 30 07:47:24 MDT 2012


Pushed to autobuild(master) after consultation with Sebastien
about attribution.

Cheers - Michael

On 2012-10-30 at 12:30 +0100, Michael Adam wrote:
> Hi Sebasiten,
> 
> On 2012-10-30 at 11:48 +0100, sebastien.laveze at mindspeed.com wrote:
> > Hi metze,
> > 
> > > > So guess the correct check would be more like it is in stable 
> > branches:
> > > > 
> > > > smb2req->in.vector_count != (SMBD_SMB2_NUM_IOV_PER_REQ + 1)
> > > > 
> > > > I mostly want to be sure I'm not gonna break something with this fix.
> > > 
> > > While this is a possible fix for now, I'd prefer
> > > 
> > > smb2req->in.vector_count >= (2*SMBD_SMB2_NUM_IOV_PER_REQ)
> > > 
> > > As I'd like to remove the magic '1' in future and completely hide the
> > > transport (NBT) header.
> > > 
> > > Can you verify the attached patch also works for you?
> > 
> > Yes works fine ! Just verified on my system.
> 
> I have reviewed the patch, too, and would push it to our master
> branch. Since you reported the probelem, and tested the patch, I would like
> to add attribution to the commit, if you are OK with it.
> 
> Having only your email address, and not the complete spelling of
> your real name, I came up with the message in the
> attached patch file...
> 
> Cheers - Michael
> 

> From a6c88dc6e5b1625f7e586995be75550c877b029f Mon Sep 17 00:00:00 2001
> From: Stefan Metzmacher <metze at samba.org>
> Date: Tue, 30 Oct 2012 11:08:19 +0100
> Subject: [PATCH] s3:smb2_read: fix SMBD_SMB2_NUM_IOV_PER_REQ check for
>  sendfile() support (bug #9341)
> 
> Reported-by: sebastien.laveze at mindspeed.com
> Signed-off-by: Stefan Metzmacher <metze at samba.org>
> Reviewed-by: Michael Adam <obnox at samba.org>
> Tested-by: sebastien.laveze at mindspeed.com
> ---
>  source3/smbd/smb2_read.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/source3/smbd/smb2_read.c b/source3/smbd/smb2_read.c
> index 2890f86..41adb03 100644
> --- a/source3/smbd/smb2_read.c
> +++ b/source3/smbd/smb2_read.c
> @@ -277,7 +277,7 @@ static NTSTATUS schedule_smb2_sendfile_read(struct smbd_smb2_request *smb2req,
>  	if (!lp__use_sendfile(SNUM(fsp->conn)) ||
>  	    smb2req->do_signing ||
>  	    smb2req->do_encryption ||
> -	    smb2req->in.vector_count < (2*SMBD_SMB2_NUM_IOV_PER_REQ) ||
> +	    smb2req->in.vector_count >= (2*SMBD_SMB2_NUM_IOV_PER_REQ) ||
>  	    (fsp->base_fsp != NULL) ||
>  	    (fsp->wcp != NULL) ||
>  	    (!S_ISREG(fsp->fsp_name->st.st_ex_mode)) ||
> -- 
> 1.7.9.5
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 206 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20121030/7fc9bf8c/attachment.pgp>


More information about the samba-technical mailing list