diff options
| author | Henrique Carvalho <henrique.carvalho@suse.com> | 2024-11-12 13:27:58 -0300 |
|---|---|---|
| committer | Henrique Carvalho <henrique.carvalho@suse.com> | 2024-11-12 13:27:58 -0300 |
| commit | fab80750cbf4aa4daf392b6ff6b461fad14d0511 (patch) | |
| tree | cd9b336aafa738d9f8c924b8581fe31f7d1c009c | |
| parent | e49466488423051343e5b185978c838c65b6f2c9 (diff) | |
| download | linux-fab80750cbf4aa4daf392b6ff6b461fad14d0511.tar.gz linux-fab80750cbf4aa4daf392b6ff6b461fad14d0511.tar.bz2 linux-fab80750cbf4aa4daf392b6ff6b461fad14d0511.zip | |
smb: client: remove support for CONFIG_CIFS_POSIX
Signed-off-by: Henrique Carvalho <henrique.carvalho@suse.com>
| -rw-r--r-- | fs/smb/client/cifs_debug.c | 3 | ||||
| -rw-r--r-- | fs/smb/client/cifspdu.h | 127 | ||||
| -rw-r--r-- | fs/smb/client/cifssmb.c | 455 | ||||
| -rw-r--r-- | fs/smb/client/ioctl.c | 4 |
4 files changed, 0 insertions, 589 deletions
diff --git a/fs/smb/client/cifs_debug.c b/fs/smb/client/cifs_debug.c index fc2ade7ebfb7..d8f33bc4c35e 100644 --- a/fs/smb/client/cifs_debug.c +++ b/fs/smb/client/cifs_debug.c @@ -334,9 +334,6 @@ static int cifs_debug_data_proc_show(struct seq_file *m, void *v) #elif defined(CONFIG_CIFS_DEBUG) seq_printf(m, ",DEBUG"); #endif -#ifdef CONFIG_CIFS_POSIX - seq_printf(m, ",CIFS_POSIX"); -#endif #ifdef CONFIG_CIFS_UPCALL seq_printf(m, ",UPCALL(SPNEGO)"); #endif diff --git a/fs/smb/client/cifspdu.h b/fs/smb/client/cifspdu.h index a2072ab9e586..f4225aceef27 100644 --- a/fs/smb/client/cifspdu.h +++ b/fs/smb/client/cifspdu.h @@ -2151,17 +2151,7 @@ typedef struct { #define CIFS_UNIX_TRANSPORT_ENCRYPTION_CAP 0x00000100 /* can do SPNEGO crypt */ #define CIFS_UNIX_TRANSPORT_ENCRYPTION_MANDATORY_CAP 0x00000200 /* must do */ #define CIFS_UNIX_PROXY_CAP 0x00000400 /* Proxy cap: 0xACE ioctl and QFS PROXY call */ -#ifdef CONFIG_CIFS_POSIX -/* presumably don't need the 0x20 POSIX_PATH_OPS_CAP since we never send - LockingX instead of posix locking call on unix sess (and we do not expect - LockingX to use different (ie Windows) semantics than posix locking on - the same session (if WINE needs to do this later, we can add this cap - back in later */ -/* #define CIFS_UNIX_CAP_MASK 0x000000fb */ -#define CIFS_UNIX_CAP_MASK 0x000003db -#else #define CIFS_UNIX_CAP_MASK 0x00000013 -#endif /* CONFIG_CIFS_POSIX */ #define CIFS_POSIX_EXTENSIONS 0x00000010 /* support for new QFSInfo */ @@ -2602,121 +2592,4 @@ struct data_blob { } __attribute__((packed)); -#ifdef CONFIG_CIFS_POSIX -/* - For better POSIX semantics from Linux client, (even better - than the existing CIFS Unix Extensions) we need updated PDUs for: - - 1) PosixCreateX - to set and return the mode, inode#, device info and - perhaps add a CreateDevice - to create Pipes and other special .inodes - Also note POSIX open flags - 2) Close - to return the last write time to do cache across close - more safely - 3) FindFirst return unique inode number - what about resume key, two - forms short (matches readdir) and full (enough info to cache inodes) - 4) Mkdir - set mode - - And under consideration: - 5) FindClose2 (return nanosecond timestamp ??) - 6) Use nanosecond timestamps throughout all time fields if - corresponding attribute flag is set - 7) sendfile - handle based copy - - what about fixing 64 bit alignment - - There are also various legacy SMB/CIFS requests used as is - - From existing Lanman and NTLM dialects: - -------------------------------------- - NEGOTIATE - SESSION_SETUP_ANDX (BB which?) - TREE_CONNECT_ANDX (BB which wct?) - TREE_DISCONNECT (BB add volume timestamp on response) - LOGOFF_ANDX - DELETE (note delete open file behavior) - DELETE_DIRECTORY - READ_AND_X - WRITE_AND_X - LOCKING_AND_X (note posix lock semantics) - RENAME (note rename across dirs and open file rename posix behaviors) - NT_RENAME (for hardlinks) Is this good enough for all features? - FIND_CLOSE2 - TRANSACTION2 (18 cases) - SMB_SET_FILE_END_OF_FILE_INFO2 SMB_SET_PATH_END_OF_FILE_INFO2 - (BB verify that never need to set allocation size) - SMB_SET_FILE_BASIC_INFO2 (setting times - BB can it be done via - Unix ext?) - - COPY (note support for copy across directories) - FUTURE, OPTIONAL - setting/getting OS/2 EAs - FUTURE (BB can this handle - setting Linux xattrs perfectly) - OPTIONAL - dnotify - FUTURE, OPTIONAL - quota - FUTURE, OPTIONAL - - Note that various requests implemented for NT interop such as - NT_TRANSACT (IOCTL) QueryReparseInfo - are unneeded to servers compliant with the CIFS POSIX extensions - - From CIFS Unix Extensions: - ------------------------- - T2 SET_PATH_INFO (SMB_SET_FILE_UNIX_LINK) for symlinks - T2 SET_PATH_INFO (SMB_SET_FILE_BASIC_INFO2) - T2 QUERY_PATH_INFO (SMB_QUERY_FILE_UNIX_LINK) - T2 QUERY_PATH_INFO (SMB_QUERY_FILE_UNIX_BASIC) BB check for missing - inode fields - Actually a need QUERY_FILE_UNIX_INFO - since has inode num - BB what about a) blksize/blkbits/blocks - b) i_version - c) i_rdev - d) notify mask? - e) generation - f) size_seqcount - T2 FIND_FIRST/FIND_NEXT FIND_FILE_UNIX - TRANS2_GET_DFS_REFERRAL - OPTIONAL but recommended - T2_QFS_INFO QueryDevice/AttributeInfo - OPTIONAL - */ - -/* xsymlink is a symlink format (used by MacOS) that can be used - to save symlink info in a regular file when - mounted to operating systems that do not - support the cifs Unix extensions or EAs (for xattr - based symlinks). For such a file to be recognized - as containing symlink data: - - 1) file size must be 1067, - 2) signature must begin file data, - 3) length field must be set to ASCII representation - of a number which is less than or equal to 1024, - 4) md5 must match that of the path data */ - -struct xsymlink { - /* 1067 bytes */ - char signature[4]; /* XSym */ /* not null terminated */ - char cr0; /* \n */ -/* ASCII representation of length (4 bytes decimal) terminated by \n not null */ - char length[4]; - char cr1; /* \n */ -/* md5 of valid subset of path ie path[0] through path[length-1] */ - __u8 md5[32]; - char cr2; /* \n */ -/* if room left, then end with \n then 0x20s by convention but not required */ - char path[1024]; -} __attribute__((packed)); - -typedef struct file_xattr_info { - /* BB do we need another field for flags? BB */ - __u32 xattr_name_len; - __u32 xattr_value_len; - char xattr_name[]; - /* followed by xattr_value[xattr_value_len], no pad */ -} __packed FILE_XATTR_INFO; /* extended attribute info level 0x205 */ - -/* flags for lsattr and chflags commands removed arein uapi/linux/fs.h */ - -typedef struct file_chattr_info { - __le64 mask; /* list of all possible attribute bits */ - __le64 mode; /* list of actual attribute bits on this inode */ -} __packed FILE_CHATTR_INFO; /* ext attributes (chattr, chflags) level 0x206 */ -#endif /* POSIX */ #endif /* _CIFSPDU_H */ diff --git a/fs/smb/client/cifssmb.c b/fs/smb/client/cifssmb.c index cfae2e918209..7a3bcf448062 100644 --- a/fs/smb/client/cifssmb.c +++ b/fs/smb/client/cifssmb.c @@ -39,31 +39,16 @@ #include "dfs_cache.h" #endif -#ifdef CONFIG_CIFS_POSIX static struct { int index; char *name; } protocols[] = { {CIFS_PROT, "\2NT LM 0.12"}, - {POSIX_PROT, "\2POSIX 2"}, {BAD_PROT, "\2"} }; -#else -static struct { - int index; - char *name; -} protocols[] = { - {CIFS_PROT, "\2NT LM 0.12"}, - {BAD_PROT, "\2"} -}; -#endif /* define the number of elements in the cifs dialect array */ -#ifdef CONFIG_CIFS_POSIX -#define CIFS_NUM_PROT 2 -#else /* not posix */ #define CIFS_NUM_PROT 1 -#endif /* CIFS_POSIX */ /* reconnect the socket, tcon, and smb session if needed */ @@ -2894,446 +2879,6 @@ CIFSSMB_set_compression(const unsigned int xid, struct cifs_tcon *tcon, } -#ifdef CONFIG_CIFS_POSIX - -#ifdef CONFIG_FS_POSIX_ACL -/** - * cifs_init_posix_acl - convert ACL from cifs to POSIX ACL format - * @ace: POSIX ACL entry to store converted ACL into - * @cifs_ace: ACL in cifs format - * - * Convert an Access Control Entry from wire format to local POSIX xattr - * format. - * - * Note that the @cifs_uid member is used to store both {g,u}id_t. - */ -static void cifs_init_posix_acl(struct posix_acl_entry *ace, - struct cifs_posix_ace *cifs_ace) -{ - /* u8 cifs fields do not need le conversion */ - ace->e_perm = cifs_ace->cifs_e_perm; - ace->e_tag = cifs_ace->cifs_e_tag; - - switch (ace->e_tag) { - case ACL_USER: - ace->e_uid = make_kuid(&init_user_ns, - le64_to_cpu(cifs_ace->cifs_uid)); - break; - case ACL_GROUP: - ace->e_gid = make_kgid(&init_user_ns, - le64_to_cpu(cifs_ace->cifs_uid)); - break; - } - return; -} - -/** - * cifs_to_posix_acl - copy cifs ACL format to POSIX ACL format - * @acl: ACLs returned in POSIX ACL format - * @src: ACLs in cifs format - * @acl_type: type of POSIX ACL requested - * @size_of_data_area: size of SMB we got - * - * This function converts ACLs from cifs format to POSIX ACL format. - * If @acl is NULL then the size of the buffer required to store POSIX ACLs in - * their uapi format is returned. - */ -static int cifs_to_posix_acl(struct posix_acl **acl, char *src, - const int acl_type, const int size_of_data_area) -{ - int size = 0; - __u16 count; - struct cifs_posix_ace *pACE; - struct cifs_posix_acl *cifs_acl = (struct cifs_posix_acl *)src; - struct posix_acl *kacl = NULL; - struct posix_acl_entry *pa, *pe; - - if (le16_to_cpu(cifs_acl->version) != CIFS_ACL_VERSION) - return -EOPNOTSUPP; - - if (acl_type == ACL_TYPE_ACCESS) { - count = le16_to_cpu(cifs_acl->access_entry_count); - pACE = &cifs_acl->ace_array[0]; - size = sizeof(struct cifs_posix_acl); - size += sizeof(struct cifs_posix_ace) * count; - /* check if we would go beyond end of SMB */ - if (size_of_data_area < size) { - cifs_dbg(FYI, "bad CIFS POSIX ACL size %d vs. %d\n", - size_of_data_area, size); - return -EINVAL; - } - } else if (acl_type == ACL_TYPE_DEFAULT) { - count = le16_to_cpu(cifs_acl->access_entry_count); - size = sizeof(struct cifs_posix_acl); - size += sizeof(struct cifs_posix_ace) * count; - /* skip past access ACEs to get to default ACEs */ - pACE = &cifs_acl->ace_array[count]; - count = le16_to_cpu(cifs_acl->default_entry_count); - size += sizeof(struct cifs_posix_ace) * count; - /* check if we would go beyond end of SMB */ - if (size_of_data_area < size) - return -EINVAL; - } else { - /* illegal type */ - return -EINVAL; - } - - /* Allocate number of POSIX ACLs to store in VFS format. */ - kacl = posix_acl_alloc(count, GFP_NOFS); - if (!kacl) - return -ENOMEM; - - FOREACH_ACL_ENTRY(pa, kacl, pe) { - cifs_init_posix_acl(pa, pACE); - pACE++; - } - - *acl = kacl; - return 0; -} - -/** - * cifs_init_ace - convert ACL entry from POSIX ACL to cifs format - * @cifs_ace: the cifs ACL entry to store into - * @local_ace: the POSIX ACL entry to convert - */ -static void cifs_init_ace(struct cifs_posix_ace *cifs_ace, - const struct posix_acl_entry *local_ace) -{ - cifs_ace->cifs_e_perm = local_ace->e_perm; - cifs_ace->cifs_e_tag = local_ace->e_tag; - - switch (local_ace->e_tag) { - case ACL_USER: - cifs_ace->cifs_uid = - cpu_to_le64(from_kuid(&init_user_ns, local_ace->e_uid)); - break; - case ACL_GROUP: - cifs_ace->cifs_uid = - cpu_to_le64(from_kgid(&init_user_ns, local_ace->e_gid)); - break; - default: - cifs_ace->cifs_uid = cpu_to_le64(-1); - } -} - -/** - * posix_acl_to_cifs - convert ACLs from POSIX ACL to cifs format - * @parm_data: ACLs in cifs format to conver to - * @acl: ACLs in POSIX ACL format to convert from - * @acl_type: the type of POSIX ACLs stored in @acl - * - * Return: the number cifs ACL entries after conversion - */ -static __u16 posix_acl_to_cifs(char *parm_data, const struct posix_acl *acl, - const int acl_type) -{ - __u16 rc = 0; - struct cifs_posix_acl *cifs_acl = (struct cifs_posix_acl *)parm_data; - const struct posix_acl_entry *pa, *pe; - int count; - int i = 0; - - if ((acl == NULL) || (cifs_acl == NULL)) - return 0; - - count = acl->a_count; - cifs_dbg(FYI, "setting acl with %d entries\n", count); - - /* - * Note that the uapi POSIX ACL version is verified by the VFS and is - * independent of the cifs ACL version. Changing the POSIX ACL version - * is a uapi change and if it's changed we will pass down the POSIX ACL - * version in struct posix_acl from the VFS. For now there's really - * only one that all filesystems know how to deal with. - */ - cifs_acl->version = cpu_to_le16(1); - if (acl_type == ACL_TYPE_ACCESS) { - cifs_acl->access_entry_count = cpu_to_le16(count); - cifs_acl->default_entry_count = cpu_to_le16(0xFFFF); - } else if (acl_type == ACL_TYPE_DEFAULT) { - cifs_acl->default_entry_count = cpu_to_le16(count); - cifs_acl->access_entry_count = cpu_to_le16(0xFFFF); - } else { - cifs_dbg(FYI, "unknown ACL type %d\n", acl_type); - return 0; - } - FOREACH_ACL_ENTRY(pa, acl, pe) { - cifs_init_ace(&cifs_acl->ace_array[i++], pa); - } - if (rc == 0) { - rc = (__u16)(count * sizeof(struct cifs_posix_ace)); - rc += sizeof(struct cifs_posix_acl); - /* BB add check to make sure ACL does not overflow SMB */ - } - return rc; -} - -int cifs_do_get_acl(const unsigned int xid, struct cifs_tcon *tcon, - const unsigned char *searchName, struct posix_acl **acl, - const int acl_type, const struct nls_table *nls_codepage, - int remap) -{ -/* SMB_QUERY_POSIX_ACL */ - TRANSACTION2_QPI_REQ *pSMB = NULL; - TRANSACTION2_QPI_RSP *pSMBr = NULL; - int rc = 0; - int bytes_returned; - int name_len; - __u16 params, byte_count; - - cifs_dbg(FYI, "In GetPosixACL (Unix) for path %s\n", searchName); - -queryAclRetry: - rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, - (void **) &pSMBr); - if (rc) - return rc; - - if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { - name_len = - cifsConvertToUTF16((__le16 *) pSMB->FileName, - searchName, PATH_MAX, nls_codepage, - remap); - name_len++; /* trailing null */ - name_len *= 2; - pSMB->FileName[name_len] = 0; - pSMB->FileName[name_len+1] = 0; - } else { - name_len = copy_path_name(pSMB->FileName, searchName); - } - - params = 2 /* level */ + 4 /* rsrvd */ + name_len /* incl null */ ; - pSMB->TotalDataCount = 0; - pSMB->MaxParameterCount = cpu_to_le16(2); - /* BB find exact max data count below from sess structure BB */ - pSMB->MaxDataCount = cpu_to_le16(4000); - pSMB->MaxSetupCount = 0; - pSMB->Reserved = 0; - pSMB->Flags = 0; - pSMB->Timeout = 0; - pSMB->Reserved2 = 0; - pSMB->ParameterOffset = cpu_to_le16( - offsetof(struct smb_com_transaction2_qpi_req, - InformationLevel) - 4); - pSMB->DataCount = 0; - pSMB->DataOffset = 0; - pSMB->SetupCount = 1; - pSMB->Reserved3 = 0; - pSMB->SubCommand = cpu_to_le16(TRANS2_QUERY_PATH_INFORMATION); - byte_count = params + 1 /* pad */ ; - pSMB->TotalParameterCount = cpu_to_le16(params); - pSMB->ParameterCount = pSMB->TotalParameterCount; - pSMB->InformationLevel = cpu_to_le16(SMB_QUERY_POSIX_ACL); - pSMB->Reserved4 = 0; - inc_rfc1001_len(pSMB, byte_count); - pSMB->ByteCount = cpu_to_le16(byte_count); - - rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, - (struct smb_hdr *) pSMBr, &bytes_returned, 0); - cifs_stats_inc(&tcon->stats.cifs_stats.num_acl_get); - if (rc) { - cifs_dbg(FYI, "Send error in Query POSIX ACL = %d\n", rc); - } else { - /* decode response */ - - rc = validate_t2((struct smb_t2_rsp *)pSMBr); - /* BB also check enough total bytes returned */ - if (rc || get_bcc(&pSMBr->hdr) < 2) - rc = -EIO; /* bad smb */ - else { - __u16 data_offset = le16_to_cpu(pSMBr->t2.DataOffset); - __u16 count = le16_to_cpu(pSMBr->t2.DataCount); - rc = cifs_to_posix_acl(acl, - (char *)&pSMBr->hdr.Protocol+data_offset, - acl_type, count); - } - } - cifs_buf_release(pSMB); - /* - * The else branch after SendReceive() doesn't return EAGAIN so if we - * allocated @acl in cifs_to_posix_acl() we are guaranteed to return - * here and don't leak POSIX ACLs. - */ - if (rc == -EAGAIN) - goto queryAclRetry; - return rc; -} - -int cifs_do_set_acl(const unsigned int xid, struct cifs_tcon *tcon, - const unsigned char *fileName, const struct posix_acl *acl, - const int acl_type, const struct nls_table *nls_codepage, - int remap) -{ - struct smb_com_transaction2_spi_req *pSMB = NULL; - struct smb_com_transaction2_spi_rsp *pSMBr = NULL; - char *parm_data; - int name_len; - int rc = 0; - int bytes_returned = 0; - __u16 params, byte_count, data_count, param_offset, offset; - - cifs_dbg(FYI, "In SetPosixACL (Unix) for path %s\n", fileName); -setAclRetry: - rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, - (void **) &pSMBr); - if (rc) - return rc; - if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { - name_len = - cifsConvertToUTF16((__le16 *) pSMB->FileName, fileName, - PATH_MAX, nls_codepage, remap); - name_len++; /* trailing null */ - name_len *= 2; - } else { - name_len = copy_path_name(pSMB->FileName, fileName); - } - params = 6 + name_len; - pSMB->MaxParameterCount = cpu_to_le16(2); - /* BB find max SMB size from sess */ - pSMB->MaxDataCount = cpu_to_le16(1000); - pSMB->MaxSetupCount = 0; - pSMB->Reserved = 0; - pSMB->Flags = 0; - pSMB->Timeout = 0; - pSMB->Reserved2 = 0; - param_offset = offsetof(struct smb_com_transaction2_spi_req, - InformationLevel) - 4; - offset = param_offset + params; - parm_data = ((char *)pSMB) + sizeof(pSMB->hdr.smb_buf_length) + offset; - pSMB->ParameterOffset = cpu_to_le16(param_offset); - - /* convert to on the wire format for POSIX ACL */ - data_count = posix_acl_to_cifs(parm_data, acl, acl_type); - - if (data_count == 0) { - rc = -EOPNOTSUPP; - goto setACLerrorExit; - } - pSMB->DataOffset = cpu_to_le16(offset); - pSMB->SetupCount = 1; - pSMB->Reserved3 = 0; - pSMB->SubCommand = cpu_to_le16(TRANS2_SET_PATH_INFORMATION); - pSMB->InformationLevel = cpu_to_le16(SMB_SET_POSIX_ACL); - byte_count = 3 /* pad */ + params + data_count; - pSMB->DataCount = cpu_to_le16(data_count); - pSMB->TotalDataCount = pSMB->DataCount; - pSMB->ParameterCount = cpu_to_le16(params); - pSMB->TotalParameterCount = pSMB->ParameterCount; - pSMB->Reserved4 = 0; - inc_rfc1001_len(pSMB, byte_count); - pSMB->ByteCount = cpu_to_le16(byte_count); - rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, - (struct smb_hdr *) pSMBr, &bytes_returned, 0); - if (rc) - cifs_dbg(FYI, "Set POSIX ACL returned %d\n", rc); - -setACLerrorExit: - cifs_buf_release(pSMB); - if (rc == -EAGAIN) - goto setAclRetry; - return rc; -} -#else -int cifs_do_get_acl(const unsigned int xid, struct cifs_tcon *tcon, - const unsigned char *searchName, struct posix_acl **acl, - const int acl_type, const struct nls_table *nls_codepage, - int remap) -{ - return -EOPNOTSUPP; -} - -int cifs_do_set_acl(const unsigned int xid, struct cifs_tcon *tcon, - const unsigned char *fileName, const struct posix_acl *acl, - const int acl_type, const struct nls_table *nls_codepage, - int remap) -{ - return -EOPNOTSUPP; -} -#endif /* CONFIG_FS_POSIX_ACL */ - -int -CIFSGetExtAttr(const unsigned int xid, struct cifs_tcon *tcon, - const int netfid, __u64 *pExtAttrBits, __u64 *pMask) -{ - int rc = 0; - struct smb_t2_qfi_req *pSMB = NULL; - struct smb_t2_qfi_rsp *pSMBr = NULL; - int bytes_returned; - __u16 params, byte_count; - - cifs_dbg(FYI, "In GetExtAttr\n"); - if (tcon == NULL) - return -ENODEV; - -GetExtAttrRetry: - rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, - (void **) &pSMBr); - if (rc) - return rc; - - params = 2 /* level */ + 2 /* fid */; - pSMB->t2.TotalDataCount = 0; - pSMB->t2.MaxParameterCount = cpu_to_le16(4); - /* BB find exact max data count below from sess structure BB */ - pSMB->t2.MaxDataCount = cpu_to_le16(4000); - pSMB->t2.MaxSetupCount = 0; - pSMB->t2.Reserved = 0; - pSMB->t2.Flags = 0; - pSMB->t2.Timeout = 0; - pSMB->t2.Reserved2 = 0; - pSMB->t2.ParameterOffset = cpu_to_le16(offsetof(struct smb_t2_qfi_req, - Fid) - 4); - pSMB->t2.DataCount = 0; - pSMB->t2.DataOffset = 0; - pSMB->t2.SetupCount = 1; - pSMB->t2.Reserved3 = 0; - pSMB->t2.SubCommand = cpu_to_le16(TRANS2_QUERY_FILE_INFORMATION); - byte_count = params + 1 /* pad */ ; - pSMB->t2.TotalParameterCount = cpu_to_le16(params); - pSMB->t2.ParameterCount = pSMB->t2.TotalParameterCount; - pSMB->InformationLevel = cpu_to_le16(SMB_QUERY_ATTR_FLAGS); - pSMB->Pad = 0; - pSMB->Fid = netfid; - inc_rfc1001_len(pSMB, byte_count); - pSMB->t2.ByteCount = cpu_to_le16(byte_count); - - rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, - (struct smb_hdr *) pSMBr, &bytes_returned, 0); - if (rc) { - cifs_dbg(FYI, "error %d in GetExtAttr\n", rc); - } else { - /* decode response */ - rc = validate_t2((struct smb_t2_rsp *)pSMBr); - /* BB also check enough total bytes returned */ - if (rc || get_bcc(&pSMBr->hdr) < 2) - /* If rc should we check for EOPNOSUPP and - disable the srvino flag? or in caller? */ - rc = -EIO; /* bad smb */ - else { - __u16 data_offset = le16_to_cpu(pSMBr->t2.DataOffset); - __u16 count = le16_to_cpu(pSMBr->t2.DataCount); - struct file_chattr_info *pfinfo; - - if (count != 16) { - cifs_dbg(FYI, "Invalid size ret in GetExtAttr\n"); - rc = -EIO; - goto GetExtAttrOut; - } - pfinfo = (struct file_chattr_info *) - (data_offset + (char *) &pSMBr->hdr.Protocol); - *pExtAttrBits = le64_to_cpu(pfinfo->mode); - *pMask = le64_to_cpu(pfinfo->mask); - } - } -GetExtAttrOut: - cifs_buf_release(pSMB); - if (rc == -EAGAIN) - goto GetExtAttrRetry; - return rc; -} - -#endif /* CONFIG_POSIX */ /* * Initialize NT TRANSACT SMB into small smb request buffer. This assumes that diff --git a/fs/smb/client/ioctl.c b/fs/smb/client/ioctl.c index ef726646ee31..d61526592329 100644 --- a/fs/smb/client/ioctl.c +++ b/fs/smb/client/ioctl.c @@ -360,8 +360,6 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg) struct tcon_link *tlink; struct cifs_sb_info *cifs_sb; __u64 ExtAttrBits = 0; -#ifdef CONFIG_CIFS_POSIX -#endif /* CONFIG_CIFS_POSIX */ xid = get_xid(); @@ -376,8 +374,6 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg) if (pSMBFile == NULL) break; tcon = tlink_tcon(pSMBFile->tlink); -#ifdef CONFIG_CIFS_POSIX -#endif /* CONFIG_CIFS_POSIX */ rc = 0; if (CIFS_I(inode)->cifsAttrs & ATTR_COMPRESSED) { /* add in the compressed bit */ |
