Re: [v4 PATCH 4/4] CIFS: Migrate to shared superblock model

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 26 May 2011 11:06:59 -0500
Steve French <smfrench@xxxxxxxxx> wrote:

> On Thu, May 26, 2011 at 10:20 AM, Jeff Layton <jlayton@xxxxxxxxxxxxxxx> wrote:
> > On Thu, 26 May 2011 10:02:01 +0400
> > Pavel Shilovsky <piastry@xxxxxxxxxxx> 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 <jlayton@xxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux