Re: [PATCH 01/45] CIFS: Make CAP_* checks protocol independent

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

 



On Mon, Jul 23, 2012 at 3:59 PM, Jeff Layton <jlayton@xxxxxxxxx> wrote:
> On Wed, 18 Jul 2012 19:48:17 +0400
> Pavel Shilovsky <pshilovsky@xxxxxxxxx> wrote:
>
>> Since both CIFS and SMB2 use ses->capabilities (server->capabilities)
>> field but flags are different we should make such checks protocol
>> independent.
>>
>> Signed-off-by: Pavel Shilovsky <pshilovsky@xxxxxxxxx>
>> ---
>>  fs/cifs/cifsglob.h |   10 ++++++++++
>>  fs/cifs/connect.c  |    6 +++---
>>  fs/cifs/dir.c      |    3 +--
>>  fs/cifs/file.c     |   33 ++++++++++++++++-----------------
>>  fs/cifs/inode.c    |   26 ++++++++++++--------------
>>  fs/cifs/link.c     |    6 +++---
>>  fs/cifs/readdir.c  |   16 ++++++++--------
>>  fs/cifs/smb1ops.c  |    3 +++
>>  fs/cifs/smb2ops.c  |    3 +++
>>  fs/cifs/smb2pdu.c  |    2 ++
>>  fs/cifs/smb2pdu.h  |    3 +++
>>  11 files changed, 64 insertions(+), 47 deletions(-)
>>
>> diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h
>> index 12b1176..5695693 100644
>> --- a/fs/cifs/cifsglob.h
>> +++ b/fs/cifs/cifsglob.h
>> @@ -258,6 +258,9 @@ struct smb_version_values {
>>       size_t          max_header_size;
>>       size_t          read_rsp_size;
>>       __le16          lock_cmd;
>> +     int             cap_unix;
>> +     int             cap_nt_find;
>> +     int             cap_large_files;
>
> These should probably be unsigned values, and the ses->capabilities and
> server->capabilities flags should be turned into unsigned values as
> well.
>
> For that matter, it's not clear to me why we have capabilities fields
> for both ses and server. I see in one case where they can be different
> (if linuxExtEnabled == 0). Probably they should be converted to always
> use the server one and we get rid of the ses one.

For the non-unix case the server returns caps on negprot (per-socket),
we negotiate them (potentially differently, less than what the server
returned on negprot) on every session setup though.  For proper
reconnection, we probably need to keep both.

For the unix specific capabilities they end up as booleans in the tcon
- as they are negotiated on the tcon (not the socket or smb session)


-- 
Thanks,

Steve
--
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