All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Shirish Pargaonkar
	<shirishpargaonkar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	phireph0x-/E1597aS9LQAvxtiuMwx3w@public.gmane.org,
	piastry-7qunaywFIewox3rIn2DAYQ@public.gmane.org
Subject: Re: [PATCH] cifs: lower default wsize when unix extensions are not used
Date: Wed, 9 Nov 2011 18:57:51 -0500	[thread overview]
Message-ID: <20111109185751.030239d4@corrin.poochiereds.net> (raw)
In-Reply-To: <CADT32eLBeJoeiJUHM5OvK=7vGG1Z5X2NUVh6Hnkfp89u1yySww-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On Wed, 9 Nov 2011 17:10:48 -0600
Shirish Pargaonkar <shirishpargaonkar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:

> On Wed, Nov 9, 2011 at 12:37 PM, Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote:
> > We've had some reports of servers (namely, the Solaris in-kernel CIFS
> > server) that don't deal properly with writes that are "too large" even
> > though they set CAP_LARGE_WRITE_ANDX. Change the default to better
> > mirror what windows clients do.
> >
> > Cc: Pavel Shilovsky <piastry-7qunaywFIewox3rIn2DAYQ@public.gmane.org>
> > Reported-by: Nick Davis <phireph0x-/E1597aS9LQAvxtiuMwx3w@public.gmane.org>
> > Signed-off-by: Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> > ---
> >  fs/cifs/connect.c |   23 +++++++++++++++++++----
> >  1 files changed, 19 insertions(+), 4 deletions(-)
> >
> > diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
> > index d6a972d..bf82f88 100644
> > --- a/fs/cifs/connect.c
> > +++ b/fs/cifs/connect.c
> > @@ -2912,18 +2912,33 @@ void cifs_setup_cifs_sb(struct smb_vol *pvolume_info,
> >  #define CIFS_DEFAULT_IOSIZE (1024 * 1024)
> >
> >  /*
> > - * Windows only supports a max of 60k reads. Default to that when posix
> > - * extensions aren't in force.
> > + * Windows only supports a max of 60kb reads and 65535 byte writes. Default to
> > + * those values when posix extensions aren't in force. In actuality here, we
> > + * use 65536 to allow for a write that is a multiple of 4k. Most servers seem
> > + * to be ok with the extra byte even though Windows doesn't send writes that
> > + * are that large.
> > + *
> > + * Citation:
> > + *
> > + * http://blogs.msdn.com/b/openspecification/archive/2009/04/10/smb-maximum-transmit-buffer-size-and-performance-tuning.aspx
> >  */
> >  #define CIFS_DEFAULT_NON_POSIX_RSIZE (60 * 1024)
> > +#define CIFS_DEFAULT_NON_POSIX_WSIZE (65536)
> >
> >  static unsigned int
> >  cifs_negotiate_wsize(struct cifs_tcon *tcon, struct smb_vol *pvolume_info)
> >  {
> >        __u64 unix_cap = le64_to_cpu(tcon->fsUnixInfo.Capability);
> >        struct TCP_Server_Info *server = tcon->ses->server;
> > -       unsigned int wsize = pvolume_info->wsize ? pvolume_info->wsize :
> > -                               CIFS_DEFAULT_IOSIZE;
> > +       unsigned int wsize;
> > +
> > +       /* start with specified wsize, or default */
> > +       if (pvolume_info->wsize)
> > +               wsize = pvolume_info->wsize;
> > +       else if (tcon->unix_ext && (unix_cap & CIFS_UNIX_LARGE_WRITE_CAP))
> > +               wsize = CIFS_DEFAULT_IOSIZE;
> > +       else
> > +               wsize = CIFS_DEFAULT_NON_POSIX_WSIZE;
> >
> >        /* can server support 24-bit write sizes? (via UNIX extensions) */
> >        if (!tcon->unix_ext || !(unix_cap & CIFS_UNIX_LARGE_WRITE_CAP))
> > --
> > 1.7.6.4
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
> > the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> >
> 
> Does this change warrant any change to mount.cifs man page as well?

Yes, it does. I want to confirm that Steve plans to merge it first, but
I plan to do a manpage update to document it.

-- 
Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

      parent reply	other threads:[~2011-11-09 23:57 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-09 18:37 [PATCH] cifs: lower default wsize when unix extensions are not used Jeff Layton
     [not found] ` <1320863843-29406-1-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2011-11-09 18:41   ` Jeff Layton
     [not found]     ` <20111109134140.2105ed9e-4QP7MXygkU+dMjc06nkz3ljfA9RmPOcC@public.gmane.org>
2011-11-09 20:55       ` Steve French
     [not found]         ` <CAH2r5mtmboSEMHbj6ixh6UGSgiTFz1Mn=ZU6fkQaCSu7n6h=EQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-11-09 21:04           ` Jeff Layton
     [not found]             ` <20111109160408.44947815-4QP7MXygkU+dMjc06nkz3ljfA9RmPOcC@public.gmane.org>
2011-11-09 21:14               ` Steve French
     [not found]                 ` <CAH2r5mtGbo4uHzp9KE_Jo3x=hkBewDM8+nvqoVqkyuG4TeRXhQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-11-09 21:34                   ` Jeff Layton
     [not found]                     ` <CAH2r5mupsXVYYkkqdC9fQ=EHfeD6ZeCzV7ggYc0wX_0NR4mhmw@mail.gmail.com>
     [not found]                       ` <CAH2r5mupsXVYYkkqdC9fQ=EHfeD6ZeCzV7ggYc0wX_0NR4mhmw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-11-09 21:41                         ` Jeff Layton
2011-11-23 18:34               ` Björn JACKE
     [not found]                 ` <E1RTHe2-004p4M-7T-dqLtpHMqGvUyWpdLl23E4A@public.gmane.org>
2011-11-23 20:04                   ` Jeff Layton
     [not found]                     ` <CAH2r5muKFRup1BwPqGuiy=+kh-NHP4fs42CC-xpZO1ryN-JK-Q@mail.gmail.com>
     [not found]                       ` <CAH2r5muKFRup1BwPqGuiy=+kh-NHP4fs42CC-xpZO1ryN-JK-Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-11-24 12:20                         ` Jeff Layton
     [not found]                           ` <20111124072036.0fa2ad0d-4QP7MXygkU+dMjc06nkz3ljfA9RmPOcC@public.gmane.org>
2011-11-25  2:30                             ` Steve French
2011-11-09 19:06   ` Pavel Shilovsky
2011-11-09 23:10   ` Shirish Pargaonkar
     [not found]     ` <CADT32eLBeJoeiJUHM5OvK=7vGG1Z5X2NUVh6Hnkfp89u1yySww-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-11-09 23:57       ` Jeff Layton [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20111109185751.030239d4@corrin.poochiereds.net \
    --to=jlayton-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
    --cc=linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=phireph0x-/E1597aS9LQAvxtiuMwx3w@public.gmane.org \
    --cc=piastry-7qunaywFIewox3rIn2DAYQ@public.gmane.org \
    --cc=shirishpargaonkar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.