From patchwork Tue Jul 29 07:56:29 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Shilovsky X-Patchwork-Id: 4638921 Return-Path: X-Original-To: patchwork-cifs-client@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id DF0ED9F38C for ; Tue, 29 Jul 2014 07:56:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 06DAE2018B for ; Tue, 29 Jul 2014 07:56:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D0A752017D for ; Tue, 29 Jul 2014 07:56:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752622AbaG2H4a (ORCPT ); Tue, 29 Jul 2014 03:56:30 -0400 Received: from mail-pa0-f48.google.com ([209.85.220.48]:54403 "EHLO mail-pa0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752146AbaG2H43 (ORCPT ); Tue, 29 Jul 2014 03:56:29 -0400 Received: by mail-pa0-f48.google.com with SMTP id et14so11940889pad.21 for ; Tue, 29 Jul 2014 00:56:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=DCVASfkn5jcz7sYVuUs0KD+apkJfcP2CT0htB1ISvDM=; b=dKKfsu3x1zuZCx5OqeD3J9nxJkfa83o5hkSvQy8GZwTp+2tKRMcQHqFj5Vdh6lHavq cG26pkdQkqv32OKSok9sdwF8YxRvff+uCyop9uk5CMp4dQiSaAqhAvjvN423iuhcQ6iz ie9Qbvuv55V0iH5UrEgypJIi+wb0tv0SMqPk0+Te2x+q3FJ/z22mDfEWE+nc44sL0Pm0 l2uzTJkZdjBpe+dSLxdO+IZ94GoVgRWbQBDvkF7xmbU03NT6a12MqE7UpDZlDzrnFGyK Lq53m3iBWTHx/xvP7+dwjvmSRmw6vv+O+i5zCGrwGYukZOBeMHKyE8eiS1OoUDxbe5V2 JSWA== MIME-Version: 1.0 X-Received: by 10.68.203.132 with SMTP id kq4mr459444pbc.12.1406620589228; Tue, 29 Jul 2014 00:56:29 -0700 (PDT) Received: by 10.70.90.136 with HTTP; Tue, 29 Jul 2014 00:56:29 -0700 (PDT) In-Reply-To: References: <1405957558-18476-1-git-send-email-pshilovsky@samba.org> <1405957558-18476-11-git-send-email-pshilovsky@samba.org> Date: Tue, 29 Jul 2014 11:56:29 +0400 X-Google-Sender-Auth: Yx2Dz-ntGxekkYlIHCzqwTCNnWc Message-ID: Subject: Re: [PATCH v3 10/16] CIFS: Use multicredits for SMB 2.1/3 writes From: Pavel Shilovsky To: Shirish Pargaonkar Cc: linux-cifs Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 2014-07-28 11:36 GMT+04:00 Pavel Shilovsky : > 2014-07-25 5:06 GMT+04:00 Shirish Pargaonkar : >> Looks correct. >> >> Reviewed-by: Shirish Pargaonkar > > Thank you for reviewing the series! > >> Only comment would be, wish there was a mnemonic/define for >> a regular op when calling add_credits_and_wake_if() for optype >> such as CIFS_ECHO_OP or CIFS_OPBREAK_OP instead of 0. > > Yes, it can make sense but should be in another patch/series. > >> Oh and super nitpick... s/reseted/reset/. > > Ok, will fix it in my smb2-dev branch on git.altlinux.org. > > -- > Best regards, > Pavel Shilovsky. Shirish, I am going to add a check (as well as removing an unnecessary comment) to write part: If you are ok with the changes I will update 10/16 and 16/16 patches and leave your Reviewed-by tags in my git tree. Thoughts? diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c index 081529f..0dbd1de 100644 --- a/fs/cifs/smb2ops.c +++ b/fs/cifs/smb2ops.c @@ -230,6 +230,9 @@ smb2_negotiate_wsize(struct cifs_tcon *tcon, struct smb_vol *volume_info) wsize = volume_info->wsize ? volume_info->wsize : CIFS_DEFAULT_IOSIZE; wsize = min_t(unsigned int, wsize, server->max_write); + if (!(server->capabilities & SMB2_GLOBAL_CAP_LARGE_MTU)) + wsize = min_t(unsigned int, wsize, SMB2_MAX_BUFFER_SIZE); + return wsize; } diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c index 3acef4b..5a6842c 100644 --- a/fs/cifs/smb2pdu.c +++ b/fs/cifs/smb2pdu.c @@ -108,7 +108,6 @@ smb2_hdr_assemble(struct smb2_hdr *hdr, __le16 smb2_cmd /* command */ , if (!tcon) goto out; - /* BB FIXME when we do write > 64K add +1 for every 64K in req or rsp */ /* GLOBAL_CAP_LARGE_MTU will only be set if dialect > SMB2.02 */ /* See sections 2.2.4 and 3.2.4.1.5 of MS-SMB2 */ if ((tcon->ses) && and the same check to read part: diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c index 0dbd1de..d0210a8 100644 --- a/fs/cifs/smb2ops.c +++ b/fs/cifs/smb2ops.c @@ -246,6 +246,9 @@ smb2_negotiate_rsize(struct cifs_tcon *tcon, struct smb_vol *volume_info) rsize = volume_info->rsize ? volume_info->rsize : CIFS_DEFAULT_IOSIZE; rsize = min_t(unsigned int, rsize, server->max_read); + if (!(server->capabilities & SMB2_GLOBAL_CAP_LARGE_MTU)) + rsize = min_t(unsigned int, rsize, SMB2_MAX_BUFFER_SIZE); + return rsize; }