On Thu, 26 May 2011 11:06:59 -0500
Steve French <[email protected]> wrote:

> On Thu, May 26, 2011 at 10:20 AM, Jeff Layton <[email protected]> wrote:
> > On Thu, 26 May 2011 10:02:01 +0400
> > Pavel Shilovsky <[email protected]> wrote:
> >
> >> Add cifs_match_super to use in sget to share superblock between mounts
> >> that have the same //server/sharename, credentials and mount options.
> >> It helps us to improve performance on work with future SMB2.1 leases.
> <snip>
> >> +static int
> >> +compare_mount_options(struct super_block *sb, struct cifs_mnt_data 
> >> *mnt_data)
> >> +{
> >> +     struct cifs_sb_info *old = CIFS_SB(sb);
> >> +     struct cifs_sb_info *new = mnt_data->cifs_sb;
> >> +
> >> +     if ((sb->s_flags & CIFS_MS_MASK) != (mnt_data->flags & CIFS_MS_MASK))
> >> +             return 0;
> >> +
> >> +     if ((old->mnt_cifs_flags & CIFS_MOUNT_MASK) !=
> >> +         (new->mnt_cifs_flags & CIFS_MOUNT_MASK))
> >> +             return 0;
> >> +
> >> +     if (old->rsize != new->rsize)
> >> +             return 0;
> >> +
> >> +     if (new->wsize && new->wsize > old->wsize)
> >> +             return 0;
> >> +
> >
> > ...also I think the above condition should be reversed. We don't want
> > to match if new->wsize is smaller than the existing one. Since the
> > specified wsize is just a starting point for negotiation, wsize now
> > means "any wsize less than or equal to this size". If the old->wsize is
> > bigger than that, then it's outside that range and we shouldn't match.
> 
> A more important question is whether the user intentionally tried to
> specify a wsize.  I don't see a problem matching a new default mount
> request (with no wsize specified, using therefore a default wsize)
> with an existing mount (with a larger explicitly specified wsize).
> If a user explicitly requests to override to a particular wsize on the 2nd
> mount - seems more logical to give them what they ask for if
> possible whether larger or smaller.
> 
> 

Good point. That will probably mean that you'll need to separately
track the "requested" wsize and the "actual" wsize. Honestly though, I
don't see this as a huge issue. I suggest we take this patch as-is and
plan to fix that later.

-- 
Jeff Layton <[email protected]>
--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to