diff options
Diffstat (limited to 'fs/cifs/connect.c')
-rw-r--r-- | fs/cifs/connect.c | 140 |
1 files changed, 122 insertions, 18 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index e568cc47a7f9..c75bae1242dc 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <linux/utsname.h> | 29 | #include <linux/utsname.h> |
30 | #include <linux/mempool.h> | 30 | #include <linux/mempool.h> |
31 | #include <linux/delay.h> | 31 | #include <linux/delay.h> |
32 | #include <linux/completion.h> | ||
32 | #include <asm/uaccess.h> | 33 | #include <asm/uaccess.h> |
33 | #include <asm/processor.h> | 34 | #include <asm/processor.h> |
34 | #include "cifspdu.h" | 35 | #include "cifspdu.h" |
@@ -44,6 +45,8 @@ | |||
44 | #define CIFS_PORT 445 | 45 | #define CIFS_PORT 445 |
45 | #define RFC1001_PORT 139 | 46 | #define RFC1001_PORT 139 |
46 | 47 | ||
48 | static DECLARE_COMPLETION(cifsd_complete); | ||
49 | |||
47 | extern void SMBencrypt(unsigned char *passwd, unsigned char *c8, | 50 | extern void SMBencrypt(unsigned char *passwd, unsigned char *c8, |
48 | unsigned char *p24); | 51 | unsigned char *p24); |
49 | extern void SMBNTencrypt(unsigned char *passwd, unsigned char *c8, | 52 | extern void SMBNTencrypt(unsigned char *passwd, unsigned char *c8, |
@@ -60,6 +63,7 @@ struct smb_vol { | |||
60 | char *in6_addr; /* ipv6 address as human readable form of in6_addr */ | 63 | char *in6_addr; /* ipv6 address as human readable form of in6_addr */ |
61 | char *iocharset; /* local code page for mapping to and from Unicode */ | 64 | char *iocharset; /* local code page for mapping to and from Unicode */ |
62 | char source_rfc1001_name[16]; /* netbios name of client */ | 65 | char source_rfc1001_name[16]; /* netbios name of client */ |
66 | char target_rfc1001_name[16]; /* netbios name of server for Win9x/ME */ | ||
63 | uid_t linux_uid; | 67 | uid_t linux_uid; |
64 | gid_t linux_gid; | 68 | gid_t linux_gid; |
65 | mode_t file_mode; | 69 | mode_t file_mode; |
@@ -74,6 +78,10 @@ struct smb_vol { | |||
74 | unsigned server_ino:1; /* use inode numbers from server ie UniqueId */ | 78 | unsigned server_ino:1; /* use inode numbers from server ie UniqueId */ |
75 | unsigned direct_io:1; | 79 | unsigned direct_io:1; |
76 | unsigned remap:1; /* set to remap seven reserved chars in filenames */ | 80 | unsigned remap:1; /* set to remap seven reserved chars in filenames */ |
81 | unsigned posix_paths:1; /* unset to not ask for posix pathnames. */ | ||
82 | unsigned sfu_emul:1; | ||
83 | unsigned nocase; /* request case insensitive filenames */ | ||
84 | unsigned nobrl; /* disable sending byte range locks to srv */ | ||
77 | unsigned int rsize; | 85 | unsigned int rsize; |
78 | unsigned int wsize; | 86 | unsigned int wsize; |
79 | unsigned int sockopt; | 87 | unsigned int sockopt; |
@@ -82,7 +90,8 @@ struct smb_vol { | |||
82 | 90 | ||
83 | static int ipv4_connect(struct sockaddr_in *psin_server, | 91 | static int ipv4_connect(struct sockaddr_in *psin_server, |
84 | struct socket **csocket, | 92 | struct socket **csocket, |
85 | char * netb_name); | 93 | char * netb_name, |
94 | char * server_netb_name); | ||
86 | static int ipv6_connect(struct sockaddr_in6 *psin_server, | 95 | static int ipv6_connect(struct sockaddr_in6 *psin_server, |
87 | struct socket **csocket); | 96 | struct socket **csocket); |
88 | 97 | ||
@@ -175,7 +184,8 @@ cifs_reconnect(struct TCP_Server_Info *server) | |||
175 | } else { | 184 | } else { |
176 | rc = ipv4_connect(&server->addr.sockAddr, | 185 | rc = ipv4_connect(&server->addr.sockAddr, |
177 | &server->ssocket, | 186 | &server->ssocket, |
178 | server->workstation_RFC1001_name); | 187 | server->workstation_RFC1001_name, |
188 | server->server_RFC1001_name); | ||
179 | } | 189 | } |
180 | if(rc) { | 190 | if(rc) { |
181 | msleep(3000); | 191 | msleep(3000); |
@@ -337,6 +347,7 @@ cifs_demultiplex_thread(struct TCP_Server_Info *server) | |||
337 | atomic_inc(&tcpSesAllocCount); | 347 | atomic_inc(&tcpSesAllocCount); |
338 | length = tcpSesAllocCount.counter; | 348 | length = tcpSesAllocCount.counter; |
339 | write_unlock(&GlobalSMBSeslock); | 349 | write_unlock(&GlobalSMBSeslock); |
350 | complete(&cifsd_complete); | ||
340 | if(length > 1) { | 351 | if(length > 1) { |
341 | mempool_resize(cifs_req_poolp, | 352 | mempool_resize(cifs_req_poolp, |
342 | length + cifs_min_rcv, | 353 | length + cifs_min_rcv, |
@@ -674,7 +685,7 @@ multi_t2_fnd: | |||
674 | msleep(125); | 685 | msleep(125); |
675 | } | 686 | } |
676 | 687 | ||
677 | if (list_empty(&server->pending_mid_q)) { | 688 | if (!list_empty(&server->pending_mid_q)) { |
678 | /* mpx threads have not exited yet give them | 689 | /* mpx threads have not exited yet give them |
679 | at least the smb send timeout time for long ops */ | 690 | at least the smb send timeout time for long ops */ |
680 | /* due to delays on oplock break requests, we need | 691 | /* due to delays on oplock break requests, we need |
@@ -711,7 +722,7 @@ multi_t2_fnd: | |||
711 | GFP_KERNEL); | 722 | GFP_KERNEL); |
712 | } | 723 | } |
713 | 724 | ||
714 | msleep(250); | 725 | complete_and_exit(&cifsd_complete, 0); |
715 | return 0; | 726 | return 0; |
716 | } | 727 | } |
717 | 728 | ||
@@ -735,7 +746,9 @@ cifs_parse_mount_options(char *options, const char *devname,struct smb_vol *vol) | |||
735 | toupper(system_utsname.nodename[i]); | 746 | toupper(system_utsname.nodename[i]); |
736 | } | 747 | } |
737 | vol->source_rfc1001_name[15] = 0; | 748 | vol->source_rfc1001_name[15] = 0; |
738 | 749 | /* null target name indicates to use *SMBSERVR default called name | |
750 | if we end up sending RFC1001 session initialize */ | ||
751 | vol->target_rfc1001_name[0] = 0; | ||
739 | vol->linux_uid = current->uid; /* current->euid instead? */ | 752 | vol->linux_uid = current->uid; /* current->euid instead? */ |
740 | vol->linux_gid = current->gid; | 753 | vol->linux_gid = current->gid; |
741 | vol->dir_mode = S_IRWXUGO; | 754 | vol->dir_mode = S_IRWXUGO; |
@@ -745,6 +758,9 @@ cifs_parse_mount_options(char *options, const char *devname,struct smb_vol *vol) | |||
745 | /* vol->retry default is 0 (i.e. "soft" limited retry not hard retry) */ | 758 | /* vol->retry default is 0 (i.e. "soft" limited retry not hard retry) */ |
746 | vol->rw = TRUE; | 759 | vol->rw = TRUE; |
747 | 760 | ||
761 | /* default is always to request posix paths. */ | ||
762 | vol->posix_paths = 1; | ||
763 | |||
748 | if (!options) | 764 | if (!options) |
749 | return 1; | 765 | return 1; |
750 | 766 | ||
@@ -985,7 +1001,31 @@ cifs_parse_mount_options(char *options, const char *devname,struct smb_vol *vol) | |||
985 | /* The string has 16th byte zero still from | 1001 | /* The string has 16th byte zero still from |
986 | set at top of the function */ | 1002 | set at top of the function */ |
987 | if((i==15) && (value[i] != 0)) | 1003 | if((i==15) && (value[i] != 0)) |
988 | printk(KERN_WARNING "CIFS: netbiosname longer than 15 and was truncated.\n"); | 1004 | printk(KERN_WARNING "CIFS: netbiosname longer than 15 truncated.\n"); |
1005 | } | ||
1006 | } else if (strnicmp(data, "servern", 7) == 0) { | ||
1007 | /* servernetbiosname specified override *SMBSERVER */ | ||
1008 | if (!value || !*value || (*value == ' ')) { | ||
1009 | cFYI(1,("empty server netbiosname specified")); | ||
1010 | } else { | ||
1011 | /* last byte, type, is 0x20 for servr type */ | ||
1012 | memset(vol->target_rfc1001_name,0x20,16); | ||
1013 | |||
1014 | for(i=0;i<15;i++) { | ||
1015 | /* BB are there cases in which a comma can be | ||
1016 | valid in this workstation netbios name (and need | ||
1017 | special handling)? */ | ||
1018 | |||
1019 | /* user or mount helper must uppercase netbiosname */ | ||
1020 | if (value[i]==0) | ||
1021 | break; | ||
1022 | else | ||
1023 | vol->target_rfc1001_name[i] = value[i]; | ||
1024 | } | ||
1025 | /* The string has 16th byte zero still from | ||
1026 | set at top of the function */ | ||
1027 | if((i==15) && (value[i] != 0)) | ||
1028 | printk(KERN_WARNING "CIFS: server netbiosname longer than 15 truncated.\n"); | ||
989 | } | 1029 | } |
990 | } else if (strnicmp(data, "credentials", 4) == 0) { | 1030 | } else if (strnicmp(data, "credentials", 4) == 0) { |
991 | /* ignore */ | 1031 | /* ignore */ |
@@ -1023,6 +1063,26 @@ cifs_parse_mount_options(char *options, const char *devname,struct smb_vol *vol) | |||
1023 | vol->remap = 1; | 1063 | vol->remap = 1; |
1024 | } else if (strnicmp(data, "nomapchars", 10) == 0) { | 1064 | } else if (strnicmp(data, "nomapchars", 10) == 0) { |
1025 | vol->remap = 0; | 1065 | vol->remap = 0; |
1066 | } else if (strnicmp(data, "sfu", 3) == 0) { | ||
1067 | vol->sfu_emul = 1; | ||
1068 | } else if (strnicmp(data, "nosfu", 5) == 0) { | ||
1069 | vol->sfu_emul = 0; | ||
1070 | } else if (strnicmp(data, "posixpaths", 10) == 0) { | ||
1071 | vol->posix_paths = 1; | ||
1072 | } else if (strnicmp(data, "noposixpaths", 12) == 0) { | ||
1073 | vol->posix_paths = 0; | ||
1074 | } else if ((strnicmp(data, "nocase", 6) == 0) || | ||
1075 | (strnicmp(data, "ignorecase", 10) == 0)) { | ||
1076 | vol->nocase = 1; | ||
1077 | } else if (strnicmp(data, "brl", 3) == 0) { | ||
1078 | vol->nobrl = 0; | ||
1079 | } else if (strnicmp(data, "nobrl", 5) == 0) { | ||
1080 | vol->nobrl = 1; | ||
1081 | /* turn off mandatory locking in mode | ||
1082 | if remote locking is turned off since the | ||
1083 | local vfs will do advisory */ | ||
1084 | if(vol->file_mode == (S_IALLUGO & ~(S_ISUID | S_IXGRP))) | ||
1085 | vol->file_mode = S_IALLUGO; | ||
1026 | } else if (strnicmp(data, "setuids", 7) == 0) { | 1086 | } else if (strnicmp(data, "setuids", 7) == 0) { |
1027 | vol->setuids = 1; | 1087 | vol->setuids = 1; |
1028 | } else if (strnicmp(data, "nosetuids", 9) == 0) { | 1088 | } else if (strnicmp(data, "nosetuids", 9) == 0) { |
@@ -1242,7 +1302,7 @@ static void rfc1002mangle(char * target,char * source, unsigned int length) | |||
1242 | 1302 | ||
1243 | static int | 1303 | static int |
1244 | ipv4_connect(struct sockaddr_in *psin_server, struct socket **csocket, | 1304 | ipv4_connect(struct sockaddr_in *psin_server, struct socket **csocket, |
1245 | char * netbios_name) | 1305 | char * netbios_name, char * target_name) |
1246 | { | 1306 | { |
1247 | int rc = 0; | 1307 | int rc = 0; |
1248 | int connected = 0; | 1308 | int connected = 0; |
@@ -1320,8 +1380,14 @@ ipv4_connect(struct sockaddr_in *psin_server, struct socket **csocket, | |||
1320 | ses_init_buf = kcalloc(1, sizeof(struct rfc1002_session_packet), GFP_KERNEL); | 1380 | ses_init_buf = kcalloc(1, sizeof(struct rfc1002_session_packet), GFP_KERNEL); |
1321 | if(ses_init_buf) { | 1381 | if(ses_init_buf) { |
1322 | ses_init_buf->trailer.session_req.called_len = 32; | 1382 | ses_init_buf->trailer.session_req.called_len = 32; |
1323 | rfc1002mangle(ses_init_buf->trailer.session_req.called_name, | 1383 | if(target_name && (target_name[0] != 0)) { |
1324 | DEFAULT_CIFS_CALLED_NAME,16); | 1384 | rfc1002mangle(ses_init_buf->trailer.session_req.called_name, |
1385 | target_name, 16); | ||
1386 | } else { | ||
1387 | rfc1002mangle(ses_init_buf->trailer.session_req.called_name, | ||
1388 | DEFAULT_CIFS_CALLED_NAME,16); | ||
1389 | } | ||
1390 | |||
1325 | ses_init_buf->trailer.session_req.calling_len = 32; | 1391 | ses_init_buf->trailer.session_req.calling_len = 32; |
1326 | /* calling name ends in null (byte 16) from old smb | 1392 | /* calling name ends in null (byte 16) from old smb |
1327 | convention. */ | 1393 | convention. */ |
@@ -1554,7 +1620,9 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb, | |||
1554 | sin_server.sin_port = htons(volume_info.port); | 1620 | sin_server.sin_port = htons(volume_info.port); |
1555 | else | 1621 | else |
1556 | sin_server.sin_port = 0; | 1622 | sin_server.sin_port = 0; |
1557 | rc = ipv4_connect(&sin_server,&csocket,volume_info.source_rfc1001_name); | 1623 | rc = ipv4_connect(&sin_server,&csocket, |
1624 | volume_info.source_rfc1001_name, | ||
1625 | volume_info.target_rfc1001_name); | ||
1558 | if (rc < 0) { | 1626 | if (rc < 0) { |
1559 | cERROR(1, | 1627 | cERROR(1, |
1560 | ("Error connecting to IPv4 socket. Aborting operation")); | 1628 | ("Error connecting to IPv4 socket. Aborting operation")); |
@@ -1604,9 +1672,11 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb, | |||
1604 | kfree(volume_info.password); | 1672 | kfree(volume_info.password); |
1605 | FreeXid(xid); | 1673 | FreeXid(xid); |
1606 | return rc; | 1674 | return rc; |
1607 | } else | 1675 | } |
1608 | rc = 0; | 1676 | wait_for_completion(&cifsd_complete); |
1677 | rc = 0; | ||
1609 | memcpy(srvTcp->workstation_RFC1001_name, volume_info.source_rfc1001_name,16); | 1678 | memcpy(srvTcp->workstation_RFC1001_name, volume_info.source_rfc1001_name,16); |
1679 | memcpy(srvTcp->server_RFC1001_name, volume_info.target_rfc1001_name,16); | ||
1610 | srvTcp->sequence_number = 0; | 1680 | srvTcp->sequence_number = 0; |
1611 | } | 1681 | } |
1612 | } | 1682 | } |
@@ -1660,8 +1730,9 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb, | |||
1660 | else | 1730 | else |
1661 | cifs_sb->wsize = CIFSMaxBufSize; /* default */ | 1731 | cifs_sb->wsize = CIFSMaxBufSize; /* default */ |
1662 | if(cifs_sb->rsize < PAGE_CACHE_SIZE) { | 1732 | if(cifs_sb->rsize < PAGE_CACHE_SIZE) { |
1663 | cifs_sb->rsize = PAGE_CACHE_SIZE; | 1733 | cifs_sb->rsize = PAGE_CACHE_SIZE; |
1664 | cERROR(1,("Attempt to set readsize for mount to less than one page (4096)")); | 1734 | /* Windows ME does this */ |
1735 | cFYI(1,("Attempt to set readsize for mount to less than one page (4096)")); | ||
1665 | } | 1736 | } |
1666 | cifs_sb->mnt_uid = volume_info.linux_uid; | 1737 | cifs_sb->mnt_uid = volume_info.linux_uid; |
1667 | cifs_sb->mnt_gid = volume_info.linux_gid; | 1738 | cifs_sb->mnt_gid = volume_info.linux_gid; |
@@ -1679,8 +1750,13 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb, | |||
1679 | cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_MAP_SPECIAL_CHR; | 1750 | cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_MAP_SPECIAL_CHR; |
1680 | if(volume_info.no_xattr) | 1751 | if(volume_info.no_xattr) |
1681 | cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_NO_XATTR; | 1752 | cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_NO_XATTR; |
1753 | if(volume_info.sfu_emul) | ||
1754 | cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_UNX_EMUL; | ||
1755 | if(volume_info.nobrl) | ||
1756 | cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_NO_BRL; | ||
1757 | |||
1682 | if(volume_info.direct_io) { | 1758 | if(volume_info.direct_io) { |
1683 | cERROR(1,("mounting share using direct i/o")); | 1759 | cFYI(1,("mounting share using direct i/o")); |
1684 | cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_DIRECT_IO; | 1760 | cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_DIRECT_IO; |
1685 | } | 1761 | } |
1686 | 1762 | ||
@@ -1694,6 +1770,7 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb, | |||
1694 | to the same server share the last value passed in | 1770 | to the same server share the last value passed in |
1695 | for the retry flag is used */ | 1771 | for the retry flag is used */ |
1696 | tcon->retry = volume_info.retry; | 1772 | tcon->retry = volume_info.retry; |
1773 | tcon->nocase = volume_info.nocase; | ||
1697 | } else { | 1774 | } else { |
1698 | tcon = tconInfoAlloc(); | 1775 | tcon = tconInfoAlloc(); |
1699 | if (tcon == NULL) | 1776 | if (tcon == NULL) |
@@ -1722,6 +1799,7 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb, | |||
1722 | if (!rc) { | 1799 | if (!rc) { |
1723 | atomic_inc(&pSesInfo->inUse); | 1800 | atomic_inc(&pSesInfo->inUse); |
1724 | tcon->retry = volume_info.retry; | 1801 | tcon->retry = volume_info.retry; |
1802 | tcon->nocase = volume_info.nocase; | ||
1725 | } | 1803 | } |
1726 | } | 1804 | } |
1727 | } | 1805 | } |
@@ -1743,8 +1821,10 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb, | |||
1743 | spin_lock(&GlobalMid_Lock); | 1821 | spin_lock(&GlobalMid_Lock); |
1744 | srvTcp->tcpStatus = CifsExiting; | 1822 | srvTcp->tcpStatus = CifsExiting; |
1745 | spin_unlock(&GlobalMid_Lock); | 1823 | spin_unlock(&GlobalMid_Lock); |
1746 | if(srvTcp->tsk) | 1824 | if(srvTcp->tsk) { |
1747 | send_sig(SIGKILL,srvTcp->tsk,1); | 1825 | send_sig(SIGKILL,srvTcp->tsk,1); |
1826 | wait_for_completion(&cifsd_complete); | ||
1827 | } | ||
1748 | } | 1828 | } |
1749 | /* If find_unc succeeded then rc == 0 so we can not end */ | 1829 | /* If find_unc succeeded then rc == 0 so we can not end */ |
1750 | if (tcon) /* up accidently freeing someone elses tcon struct */ | 1830 | if (tcon) /* up accidently freeing someone elses tcon struct */ |
@@ -1757,8 +1837,10 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb, | |||
1757 | temp_rc = CIFSSMBLogoff(xid, pSesInfo); | 1837 | temp_rc = CIFSSMBLogoff(xid, pSesInfo); |
1758 | /* if the socketUseCount is now zero */ | 1838 | /* if the socketUseCount is now zero */ |
1759 | if((temp_rc == -ESHUTDOWN) && | 1839 | if((temp_rc == -ESHUTDOWN) && |
1760 | (pSesInfo->server->tsk)) | 1840 | (pSesInfo->server->tsk)) { |
1761 | send_sig(SIGKILL,pSesInfo->server->tsk,1); | 1841 | send_sig(SIGKILL,pSesInfo->server->tsk,1); |
1842 | wait_for_completion(&cifsd_complete); | ||
1843 | } | ||
1762 | } else | 1844 | } else |
1763 | cFYI(1, ("No session or bad tcon")); | 1845 | cFYI(1, ("No session or bad tcon")); |
1764 | sesInfoFree(pSesInfo); | 1846 | sesInfoFree(pSesInfo); |
@@ -1781,6 +1863,17 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb, | |||
1781 | cFYI(1,("server negotiated posix acl support")); | 1863 | cFYI(1,("server negotiated posix acl support")); |
1782 | sb->s_flags |= MS_POSIXACL; | 1864 | sb->s_flags |= MS_POSIXACL; |
1783 | } | 1865 | } |
1866 | |||
1867 | /* Try and negotiate POSIX pathnames if we can. */ | ||
1868 | if (volume_info.posix_paths && (CIFS_UNIX_POSIX_PATHNAMES_CAP & | ||
1869 | le64_to_cpu(tcon->fsUnixInfo.Capability))) { | ||
1870 | if (!CIFSSMBSetFSUnixInfo(xid, tcon, CIFS_UNIX_POSIX_PATHNAMES_CAP)) { | ||
1871 | cFYI(1,("negotiated posix pathnames support")); | ||
1872 | cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_POSIX_PATHS; | ||
1873 | } else { | ||
1874 | cFYI(1,("posix pathnames support requested but not supported")); | ||
1875 | } | ||
1876 | } | ||
1784 | } | 1877 | } |
1785 | } | 1878 | } |
1786 | } | 1879 | } |
@@ -1830,6 +1923,7 @@ CIFSSessSetup(unsigned int xid, struct cifsSesInfo *ses, | |||
1830 | header_assemble(smb_buffer, SMB_COM_SESSION_SETUP_ANDX, | 1923 | header_assemble(smb_buffer, SMB_COM_SESSION_SETUP_ANDX, |
1831 | NULL /* no tCon exists yet */ , 13 /* wct */ ); | 1924 | NULL /* no tCon exists yet */ , 13 /* wct */ ); |
1832 | 1925 | ||
1926 | smb_buffer->Mid = GetNextMid(ses->server); | ||
1833 | pSMB->req_no_secext.AndXCommand = 0xFF; | 1927 | pSMB->req_no_secext.AndXCommand = 0xFF; |
1834 | pSMB->req_no_secext.MaxBufferSize = cpu_to_le16(ses->server->maxBuf); | 1928 | pSMB->req_no_secext.MaxBufferSize = cpu_to_le16(ses->server->maxBuf); |
1835 | pSMB->req_no_secext.MaxMpxCount = cpu_to_le16(ses->server->maxReq); | 1929 | pSMB->req_no_secext.MaxMpxCount = cpu_to_le16(ses->server->maxReq); |
@@ -2105,6 +2199,8 @@ CIFSSpnegoSessSetup(unsigned int xid, struct cifsSesInfo *ses, | |||
2105 | /* send SMBsessionSetup here */ | 2199 | /* send SMBsessionSetup here */ |
2106 | header_assemble(smb_buffer, SMB_COM_SESSION_SETUP_ANDX, | 2200 | header_assemble(smb_buffer, SMB_COM_SESSION_SETUP_ANDX, |
2107 | NULL /* no tCon exists yet */ , 12 /* wct */ ); | 2201 | NULL /* no tCon exists yet */ , 12 /* wct */ ); |
2202 | |||
2203 | smb_buffer->Mid = GetNextMid(ses->server); | ||
2108 | pSMB->req.hdr.Flags2 |= SMBFLG2_EXT_SEC; | 2204 | pSMB->req.hdr.Flags2 |= SMBFLG2_EXT_SEC; |
2109 | pSMB->req.AndXCommand = 0xFF; | 2205 | pSMB->req.AndXCommand = 0xFF; |
2110 | pSMB->req.MaxBufferSize = cpu_to_le16(ses->server->maxBuf); | 2206 | pSMB->req.MaxBufferSize = cpu_to_le16(ses->server->maxBuf); |
@@ -2371,6 +2467,8 @@ CIFSNTLMSSPNegotiateSessSetup(unsigned int xid, | |||
2371 | /* send SMBsessionSetup here */ | 2467 | /* send SMBsessionSetup here */ |
2372 | header_assemble(smb_buffer, SMB_COM_SESSION_SETUP_ANDX, | 2468 | header_assemble(smb_buffer, SMB_COM_SESSION_SETUP_ANDX, |
2373 | NULL /* no tCon exists yet */ , 12 /* wct */ ); | 2469 | NULL /* no tCon exists yet */ , 12 /* wct */ ); |
2470 | |||
2471 | smb_buffer->Mid = GetNextMid(ses->server); | ||
2374 | pSMB->req.hdr.Flags2 |= SMBFLG2_EXT_SEC; | 2472 | pSMB->req.hdr.Flags2 |= SMBFLG2_EXT_SEC; |
2375 | pSMB->req.hdr.Flags |= (SMBFLG_CASELESS | SMBFLG_CANONICAL_PATH_FORMAT); | 2473 | pSMB->req.hdr.Flags |= (SMBFLG_CASELESS | SMBFLG_CANONICAL_PATH_FORMAT); |
2376 | 2474 | ||
@@ -2713,6 +2811,8 @@ CIFSNTLMSSPAuthSessSetup(unsigned int xid, struct cifsSesInfo *ses, | |||
2713 | /* send SMBsessionSetup here */ | 2811 | /* send SMBsessionSetup here */ |
2714 | header_assemble(smb_buffer, SMB_COM_SESSION_SETUP_ANDX, | 2812 | header_assemble(smb_buffer, SMB_COM_SESSION_SETUP_ANDX, |
2715 | NULL /* no tCon exists yet */ , 12 /* wct */ ); | 2813 | NULL /* no tCon exists yet */ , 12 /* wct */ ); |
2814 | |||
2815 | smb_buffer->Mid = GetNextMid(ses->server); | ||
2716 | pSMB->req.hdr.Flags |= (SMBFLG_CASELESS | SMBFLG_CANONICAL_PATH_FORMAT); | 2816 | pSMB->req.hdr.Flags |= (SMBFLG_CASELESS | SMBFLG_CANONICAL_PATH_FORMAT); |
2717 | pSMB->req.hdr.Flags2 |= SMBFLG2_EXT_SEC; | 2817 | pSMB->req.hdr.Flags2 |= SMBFLG2_EXT_SEC; |
2718 | pSMB->req.AndXCommand = 0xFF; | 2818 | pSMB->req.AndXCommand = 0xFF; |
@@ -3084,6 +3184,8 @@ CIFSTCon(unsigned int xid, struct cifsSesInfo *ses, | |||
3084 | 3184 | ||
3085 | header_assemble(smb_buffer, SMB_COM_TREE_CONNECT_ANDX, | 3185 | header_assemble(smb_buffer, SMB_COM_TREE_CONNECT_ANDX, |
3086 | NULL /*no tid */ , 4 /*wct */ ); | 3186 | NULL /*no tid */ , 4 /*wct */ ); |
3187 | |||
3188 | smb_buffer->Mid = GetNextMid(ses->server); | ||
3087 | smb_buffer->Uid = ses->Suid; | 3189 | smb_buffer->Uid = ses->Suid; |
3088 | pSMB = (TCONX_REQ *) smb_buffer; | 3190 | pSMB = (TCONX_REQ *) smb_buffer; |
3089 | pSMBr = (TCONX_RSP *) smb_buffer_response; | 3191 | pSMBr = (TCONX_RSP *) smb_buffer_response; |
@@ -3205,8 +3307,10 @@ cifs_umount(struct super_block *sb, struct cifs_sb_info *cifs_sb) | |||
3205 | return 0; | 3307 | return 0; |
3206 | } else if (rc == -ESHUTDOWN) { | 3308 | } else if (rc == -ESHUTDOWN) { |
3207 | cFYI(1,("Waking up socket by sending it signal")); | 3309 | cFYI(1,("Waking up socket by sending it signal")); |
3208 | if(cifsd_task) | 3310 | if(cifsd_task) { |
3209 | send_sig(SIGKILL,cifsd_task,1); | 3311 | send_sig(SIGKILL,cifsd_task,1); |
3312 | wait_for_completion(&cifsd_complete); | ||
3313 | } | ||
3210 | rc = 0; | 3314 | rc = 0; |
3211 | } /* else - we have an smb session | 3315 | } /* else - we have an smb session |
3212 | left on this socket do not kill cifsd */ | 3316 | left on this socket do not kill cifsd */ |