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

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

 



2011/5/26 Pavel Shilovsky <piastry@xxxxxxxxxxx>:
> 2011/5/26 Steve French <smfrench@xxxxxxxxx>:
>> 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.
>>
>
> If I understand right, Jeff suggested to change wsize logic to: "less
> or equal that specified one". In this case we can share any sb that
> match this criteria. So, in this case it should be "if (new->wsize &&
> new->wsize <= old->wsize) return 0;"

Sorry - new->wsize >= old->wsize
>
> --
> Best regards,
> Pavel Shilovsky.
>



-- 
Best regards,
Pavel Shilovsky.
--
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