diff options
Diffstat (limited to 'fs/cifs/connect.c')
-rw-r--r-- | fs/cifs/connect.c | 171 |
1 files changed, 96 insertions, 75 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 19ee11f7f35a..65d0ba72e78f 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * fs/cifs/connect.c | 2 | * fs/cifs/connect.c |
3 | * | 3 | * |
4 | * Copyright (C) International Business Machines Corp., 2002,2007 | 4 | * Copyright (C) International Business Machines Corp., 2002,2008 |
5 | * Author(s): Steve French (sfrench@us.ibm.com) | 5 | * Author(s): Steve French (sfrench@us.ibm.com) |
6 | * | 6 | * |
7 | * This library is free software; you can redistribute it and/or modify | 7 | * This library is free software; you can redistribute it and/or modify |
@@ -160,7 +160,7 @@ cifs_reconnect(struct TCP_Server_Info *server) | |||
160 | if (server->ssocket) { | 160 | if (server->ssocket) { |
161 | cFYI(1, ("State: 0x%x Flags: 0x%lx", server->ssocket->state, | 161 | cFYI(1, ("State: 0x%x Flags: 0x%lx", server->ssocket->state, |
162 | server->ssocket->flags)); | 162 | server->ssocket->flags)); |
163 | server->ssocket->ops->shutdown(server->ssocket, SEND_SHUTDOWN); | 163 | kernel_sock_shutdown(server->ssocket, SHUT_WR); |
164 | cFYI(1, ("Post shutdown state: 0x%x Flags: 0x%lx", | 164 | cFYI(1, ("Post shutdown state: 0x%x Flags: 0x%lx", |
165 | server->ssocket->state, | 165 | server->ssocket->state, |
166 | server->ssocket->flags)); | 166 | server->ssocket->flags)); |
@@ -438,9 +438,9 @@ incomplete_rcv: | |||
438 | csocket = server->ssocket; | 438 | csocket = server->ssocket; |
439 | wake_up(&server->response_q); | 439 | wake_up(&server->response_q); |
440 | continue; | 440 | continue; |
441 | } else if (length < 4) { | 441 | } else if (length < pdu_length) { |
442 | cFYI(1, ("less than four bytes received (%d bytes)", | 442 | cFYI(1, ("requested %d bytes but only got %d bytes", |
443 | length)); | 443 | pdu_length, length)); |
444 | pdu_length -= length; | 444 | pdu_length -= length; |
445 | msleep(1); | 445 | msleep(1); |
446 | goto incomplete_rcv; | 446 | goto incomplete_rcv; |
@@ -752,6 +752,7 @@ multi_t2_fnd: | |||
752 | } | 752 | } |
753 | write_unlock(&GlobalSMBSeslock); | 753 | write_unlock(&GlobalSMBSeslock); |
754 | 754 | ||
755 | kfree(server->hostname); | ||
755 | kfree(server); | 756 | kfree(server); |
756 | if (length > 0) | 757 | if (length > 0) |
757 | mempool_resize(cifs_req_poolp, length + cifs_min_rcv, | 758 | mempool_resize(cifs_req_poolp, length + cifs_min_rcv, |
@@ -760,6 +761,34 @@ multi_t2_fnd: | |||
760 | return 0; | 761 | return 0; |
761 | } | 762 | } |
762 | 763 | ||
764 | /* extract the host portion of the UNC string */ | ||
765 | static char * | ||
766 | extract_hostname(const char *unc) | ||
767 | { | ||
768 | const char *src; | ||
769 | char *dst, *delim; | ||
770 | unsigned int len; | ||
771 | |||
772 | /* skip double chars at beginning of string */ | ||
773 | /* BB: check validity of these bytes? */ | ||
774 | src = unc + 2; | ||
775 | |||
776 | /* delimiter between hostname and sharename is always '\\' now */ | ||
777 | delim = strchr(src, '\\'); | ||
778 | if (!delim) | ||
779 | return ERR_PTR(-EINVAL); | ||
780 | |||
781 | len = delim - src; | ||
782 | dst = kmalloc((len + 1), GFP_KERNEL); | ||
783 | if (dst == NULL) | ||
784 | return ERR_PTR(-ENOMEM); | ||
785 | |||
786 | memcpy(dst, src, len); | ||
787 | dst[len] = '\0'; | ||
788 | |||
789 | return dst; | ||
790 | } | ||
791 | |||
763 | static int | 792 | static int |
764 | cifs_parse_mount_options(char *options, const char *devname, | 793 | cifs_parse_mount_options(char *options, const char *devname, |
765 | struct smb_vol *vol) | 794 | struct smb_vol *vol) |
@@ -793,7 +822,7 @@ cifs_parse_mount_options(char *options, const char *devname, | |||
793 | vol->linux_gid = current->gid; | 822 | vol->linux_gid = current->gid; |
794 | vol->dir_mode = S_IRWXUGO; | 823 | vol->dir_mode = S_IRWXUGO; |
795 | /* 2767 perms indicate mandatory locking support */ | 824 | /* 2767 perms indicate mandatory locking support */ |
796 | vol->file_mode = S_IALLUGO & ~(S_ISUID | S_IXGRP); | 825 | vol->file_mode = (S_IRWXUGO | S_ISGID) & (~S_IXGRP); |
797 | 826 | ||
798 | /* vol->retry default is 0 (i.e. "soft" limited retry not hard retry) */ | 827 | /* vol->retry default is 0 (i.e. "soft" limited retry not hard retry) */ |
799 | vol->rw = TRUE; | 828 | vol->rw = TRUE; |
@@ -1381,7 +1410,7 @@ connect_to_dfs_path(int xid, struct cifsSesInfo *pSesInfo, | |||
1381 | const char *old_path, const struct nls_table *nls_codepage, | 1410 | const char *old_path, const struct nls_table *nls_codepage, |
1382 | int remap) | 1411 | int remap) |
1383 | { | 1412 | { |
1384 | unsigned char *referrals = NULL; | 1413 | struct dfs_info3_param *referrals = NULL; |
1385 | unsigned int num_referrals; | 1414 | unsigned int num_referrals; |
1386 | int rc = 0; | 1415 | int rc = 0; |
1387 | 1416 | ||
@@ -1400,12 +1429,14 @@ connect_to_dfs_path(int xid, struct cifsSesInfo *pSesInfo, | |||
1400 | int | 1429 | int |
1401 | get_dfs_path(int xid, struct cifsSesInfo *pSesInfo, const char *old_path, | 1430 | get_dfs_path(int xid, struct cifsSesInfo *pSesInfo, const char *old_path, |
1402 | const struct nls_table *nls_codepage, unsigned int *pnum_referrals, | 1431 | const struct nls_table *nls_codepage, unsigned int *pnum_referrals, |
1403 | unsigned char **preferrals, int remap) | 1432 | struct dfs_info3_param **preferrals, int remap) |
1404 | { | 1433 | { |
1405 | char *temp_unc; | 1434 | char *temp_unc; |
1406 | int rc = 0; | 1435 | int rc = 0; |
1436 | unsigned char *targetUNCs; | ||
1407 | 1437 | ||
1408 | *pnum_referrals = 0; | 1438 | *pnum_referrals = 0; |
1439 | *preferrals = NULL; | ||
1409 | 1440 | ||
1410 | if (pSesInfo->ipc_tid == 0) { | 1441 | if (pSesInfo->ipc_tid == 0) { |
1411 | temp_unc = kmalloc(2 /* for slashes */ + | 1442 | temp_unc = kmalloc(2 /* for slashes */ + |
@@ -1425,8 +1456,10 @@ get_dfs_path(int xid, struct cifsSesInfo *pSesInfo, const char *old_path, | |||
1425 | kfree(temp_unc); | 1456 | kfree(temp_unc); |
1426 | } | 1457 | } |
1427 | if (rc == 0) | 1458 | if (rc == 0) |
1428 | rc = CIFSGetDFSRefer(xid, pSesInfo, old_path, preferrals, | 1459 | rc = CIFSGetDFSRefer(xid, pSesInfo, old_path, &targetUNCs, |
1429 | pnum_referrals, nls_codepage, remap); | 1460 | pnum_referrals, nls_codepage, remap); |
1461 | /* BB map targetUNCs to dfs_info3 structures, here or | ||
1462 | in CIFSGetDFSRefer BB */ | ||
1430 | 1463 | ||
1431 | return rc; | 1464 | return rc; |
1432 | } | 1465 | } |
@@ -1781,16 +1814,13 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb, | |||
1781 | 1814 | ||
1782 | memset(&volume_info, 0, sizeof(struct smb_vol)); | 1815 | memset(&volume_info, 0, sizeof(struct smb_vol)); |
1783 | if (cifs_parse_mount_options(mount_data, devname, &volume_info)) { | 1816 | if (cifs_parse_mount_options(mount_data, devname, &volume_info)) { |
1784 | kfree(volume_info.UNC); | 1817 | rc = -EINVAL; |
1785 | kfree(volume_info.password); | 1818 | goto out; |
1786 | kfree(volume_info.prepath); | ||
1787 | FreeXid(xid); | ||
1788 | return -EINVAL; | ||
1789 | } | 1819 | } |
1790 | 1820 | ||
1791 | if (volume_info.nullauth) { | 1821 | if (volume_info.nullauth) { |
1792 | cFYI(1, ("null user")); | 1822 | cFYI(1, ("null user")); |
1793 | volume_info.username = NULL; | 1823 | volume_info.username = ""; |
1794 | } else if (volume_info.username) { | 1824 | } else if (volume_info.username) { |
1795 | /* BB fixme parse for domain name here */ | 1825 | /* BB fixme parse for domain name here */ |
1796 | cFYI(1, ("Username: %s", volume_info.username)); | 1826 | cFYI(1, ("Username: %s", volume_info.username)); |
@@ -1798,11 +1828,8 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb, | |||
1798 | cifserror("No username specified"); | 1828 | cifserror("No username specified"); |
1799 | /* In userspace mount helper we can get user name from alternate | 1829 | /* In userspace mount helper we can get user name from alternate |
1800 | locations such as env variables and files on disk */ | 1830 | locations such as env variables and files on disk */ |
1801 | kfree(volume_info.UNC); | 1831 | rc = -EINVAL; |
1802 | kfree(volume_info.password); | 1832 | goto out; |
1803 | kfree(volume_info.prepath); | ||
1804 | FreeXid(xid); | ||
1805 | return -EINVAL; | ||
1806 | } | 1833 | } |
1807 | 1834 | ||
1808 | if (volume_info.UNCip && volume_info.UNC) { | 1835 | if (volume_info.UNCip && volume_info.UNC) { |
@@ -1821,11 +1848,8 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb, | |||
1821 | 1848 | ||
1822 | if (rc <= 0) { | 1849 | if (rc <= 0) { |
1823 | /* we failed translating address */ | 1850 | /* we failed translating address */ |
1824 | kfree(volume_info.UNC); | 1851 | rc = -EINVAL; |
1825 | kfree(volume_info.password); | 1852 | goto out; |
1826 | kfree(volume_info.prepath); | ||
1827 | FreeXid(xid); | ||
1828 | return -EINVAL; | ||
1829 | } | 1853 | } |
1830 | 1854 | ||
1831 | cFYI(1, ("UNC: %s ip: %s", volume_info.UNC, volume_info.UNCip)); | 1855 | cFYI(1, ("UNC: %s ip: %s", volume_info.UNC, volume_info.UNCip)); |
@@ -1835,20 +1859,14 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb, | |||
1835 | /* BB using ip addr as server name to connect to the | 1859 | /* BB using ip addr as server name to connect to the |
1836 | DFS root below */ | 1860 | DFS root below */ |
1837 | cERROR(1, ("Connecting to DFS root not implemented yet")); | 1861 | cERROR(1, ("Connecting to DFS root not implemented yet")); |
1838 | kfree(volume_info.UNC); | 1862 | rc = -EINVAL; |
1839 | kfree(volume_info.password); | 1863 | goto out; |
1840 | kfree(volume_info.prepath); | ||
1841 | FreeXid(xid); | ||
1842 | return -EINVAL; | ||
1843 | } else /* which servers DFS root would we conect to */ { | 1864 | } else /* which servers DFS root would we conect to */ { |
1844 | cERROR(1, | 1865 | cERROR(1, |
1845 | ("CIFS mount error: No UNC path (e.g. -o " | 1866 | ("CIFS mount error: No UNC path (e.g. -o " |
1846 | "unc=//192.168.1.100/public) specified")); | 1867 | "unc=//192.168.1.100/public) specified")); |
1847 | kfree(volume_info.UNC); | 1868 | rc = -EINVAL; |
1848 | kfree(volume_info.password); | 1869 | goto out; |
1849 | kfree(volume_info.prepath); | ||
1850 | FreeXid(xid); | ||
1851 | return -EINVAL; | ||
1852 | } | 1870 | } |
1853 | 1871 | ||
1854 | /* this is needed for ASCII cp to Unicode converts */ | 1872 | /* this is needed for ASCII cp to Unicode converts */ |
@@ -1860,11 +1878,8 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb, | |||
1860 | if (cifs_sb->local_nls == NULL) { | 1878 | if (cifs_sb->local_nls == NULL) { |
1861 | cERROR(1, ("CIFS mount error: iocharset %s not found", | 1879 | cERROR(1, ("CIFS mount error: iocharset %s not found", |
1862 | volume_info.iocharset)); | 1880 | volume_info.iocharset)); |
1863 | kfree(volume_info.UNC); | 1881 | rc = -ELIBACC; |
1864 | kfree(volume_info.password); | 1882 | goto out; |
1865 | kfree(volume_info.prepath); | ||
1866 | FreeXid(xid); | ||
1867 | return -ELIBACC; | ||
1868 | } | 1883 | } |
1869 | } | 1884 | } |
1870 | 1885 | ||
@@ -1878,11 +1893,8 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb, | |||
1878 | &sin_server6.sin6_addr, | 1893 | &sin_server6.sin6_addr, |
1879 | volume_info.username, &srvTcp); | 1894 | volume_info.username, &srvTcp); |
1880 | } else { | 1895 | } else { |
1881 | kfree(volume_info.UNC); | 1896 | rc = -EINVAL; |
1882 | kfree(volume_info.password); | 1897 | goto out; |
1883 | kfree(volume_info.prepath); | ||
1884 | FreeXid(xid); | ||
1885 | return -EINVAL; | ||
1886 | } | 1898 | } |
1887 | 1899 | ||
1888 | if (srvTcp) { | 1900 | if (srvTcp) { |
@@ -1906,22 +1918,14 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb, | |||
1906 | "Aborting operation")); | 1918 | "Aborting operation")); |
1907 | if (csocket != NULL) | 1919 | if (csocket != NULL) |
1908 | sock_release(csocket); | 1920 | sock_release(csocket); |
1909 | kfree(volume_info.UNC); | 1921 | goto out; |
1910 | kfree(volume_info.password); | ||
1911 | kfree(volume_info.prepath); | ||
1912 | FreeXid(xid); | ||
1913 | return rc; | ||
1914 | } | 1922 | } |
1915 | 1923 | ||
1916 | srvTcp = kzalloc(sizeof(struct TCP_Server_Info), GFP_KERNEL); | 1924 | srvTcp = kzalloc(sizeof(struct TCP_Server_Info), GFP_KERNEL); |
1917 | if (!srvTcp) { | 1925 | if (!srvTcp) { |
1918 | rc = -ENOMEM; | 1926 | rc = -ENOMEM; |
1919 | sock_release(csocket); | 1927 | sock_release(csocket); |
1920 | kfree(volume_info.UNC); | 1928 | goto out; |
1921 | kfree(volume_info.password); | ||
1922 | kfree(volume_info.prepath); | ||
1923 | FreeXid(xid); | ||
1924 | return rc; | ||
1925 | } else { | 1929 | } else { |
1926 | memcpy(&srvTcp->addr.sockAddr, &sin_server, | 1930 | memcpy(&srvTcp->addr.sockAddr, &sin_server, |
1927 | sizeof(struct sockaddr_in)); | 1931 | sizeof(struct sockaddr_in)); |
@@ -1929,6 +1933,12 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb, | |||
1929 | /* BB Add code for ipv6 case too */ | 1933 | /* BB Add code for ipv6 case too */ |
1930 | srvTcp->ssocket = csocket; | 1934 | srvTcp->ssocket = csocket; |
1931 | srvTcp->protocolType = IPV4; | 1935 | srvTcp->protocolType = IPV4; |
1936 | srvTcp->hostname = extract_hostname(volume_info.UNC); | ||
1937 | if (IS_ERR(srvTcp->hostname)) { | ||
1938 | rc = PTR_ERR(srvTcp->hostname); | ||
1939 | sock_release(csocket); | ||
1940 | goto out; | ||
1941 | } | ||
1932 | init_waitqueue_head(&srvTcp->response_q); | 1942 | init_waitqueue_head(&srvTcp->response_q); |
1933 | init_waitqueue_head(&srvTcp->request_q); | 1943 | init_waitqueue_head(&srvTcp->request_q); |
1934 | INIT_LIST_HEAD(&srvTcp->pending_mid_q); | 1944 | INIT_LIST_HEAD(&srvTcp->pending_mid_q); |
@@ -1938,16 +1948,13 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb, | |||
1938 | srvTcp->tcpStatus = CifsNew; | 1948 | srvTcp->tcpStatus = CifsNew; |
1939 | init_MUTEX(&srvTcp->tcpSem); | 1949 | init_MUTEX(&srvTcp->tcpSem); |
1940 | srvTcp->tsk = kthread_run((void *)(void *)cifs_demultiplex_thread, srvTcp, "cifsd"); | 1950 | srvTcp->tsk = kthread_run((void *)(void *)cifs_demultiplex_thread, srvTcp, "cifsd"); |
1941 | if ( IS_ERR(srvTcp->tsk) ) { | 1951 | if (IS_ERR(srvTcp->tsk)) { |
1942 | rc = PTR_ERR(srvTcp->tsk); | 1952 | rc = PTR_ERR(srvTcp->tsk); |
1943 | cERROR(1, ("error %d create cifsd thread", rc)); | 1953 | cERROR(1, ("error %d create cifsd thread", rc)); |
1944 | srvTcp->tsk = NULL; | 1954 | srvTcp->tsk = NULL; |
1945 | sock_release(csocket); | 1955 | sock_release(csocket); |
1946 | kfree(volume_info.UNC); | 1956 | kfree(srvTcp->hostname); |
1947 | kfree(volume_info.password); | 1957 | goto out; |
1948 | kfree(volume_info.prepath); | ||
1949 | FreeXid(xid); | ||
1950 | return rc; | ||
1951 | } | 1958 | } |
1952 | wait_for_completion(&cifsd_complete); | 1959 | wait_for_completion(&cifsd_complete); |
1953 | rc = 0; | 1960 | rc = 0; |
@@ -1961,9 +1968,15 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb, | |||
1961 | 1968 | ||
1962 | if (existingCifsSes) { | 1969 | if (existingCifsSes) { |
1963 | pSesInfo = existingCifsSes; | 1970 | pSesInfo = existingCifsSes; |
1964 | cFYI(1, ("Existing smb sess found")); | 1971 | cFYI(1, ("Existing smb sess found (status=%d)", |
1965 | kfree(volume_info.password); | 1972 | pSesInfo->status)); |
1966 | /* volume_info.UNC freed at end of function */ | 1973 | down(&pSesInfo->sesSem); |
1974 | if (pSesInfo->status == CifsNeedReconnect) { | ||
1975 | cFYI(1, ("Session needs reconnect")); | ||
1976 | rc = cifs_setup_session(xid, pSesInfo, | ||
1977 | cifs_sb->local_nls); | ||
1978 | } | ||
1979 | up(&pSesInfo->sesSem); | ||
1967 | } else if (!rc) { | 1980 | } else if (!rc) { |
1968 | cFYI(1, ("Existing smb sess not found")); | 1981 | cFYI(1, ("Existing smb sess not found")); |
1969 | pSesInfo = sesInfoAlloc(); | 1982 | pSesInfo = sesInfoAlloc(); |
@@ -1977,8 +1990,11 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb, | |||
1977 | 1990 | ||
1978 | if (!rc) { | 1991 | if (!rc) { |
1979 | /* volume_info.password freed at unmount */ | 1992 | /* volume_info.password freed at unmount */ |
1980 | if (volume_info.password) | 1993 | if (volume_info.password) { |
1981 | pSesInfo->password = volume_info.password; | 1994 | pSesInfo->password = volume_info.password; |
1995 | /* set to NULL to prevent freeing on exit */ | ||
1996 | volume_info.password = NULL; | ||
1997 | } | ||
1982 | if (volume_info.username) | 1998 | if (volume_info.username) |
1983 | strncpy(pSesInfo->userName, | 1999 | strncpy(pSesInfo->userName, |
1984 | volume_info.username, | 2000 | volume_info.username, |
@@ -2000,8 +2016,7 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb, | |||
2000 | up(&pSesInfo->sesSem); | 2016 | up(&pSesInfo->sesSem); |
2001 | if (!rc) | 2017 | if (!rc) |
2002 | atomic_inc(&srvTcp->socketUseCount); | 2018 | atomic_inc(&srvTcp->socketUseCount); |
2003 | } else | 2019 | } |
2004 | kfree(volume_info.password); | ||
2005 | } | 2020 | } |
2006 | 2021 | ||
2007 | /* search for existing tcon to this server share */ | 2022 | /* search for existing tcon to this server share */ |
@@ -2106,9 +2121,8 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb, | |||
2106 | "", cifs_sb->local_nls, | 2121 | "", cifs_sb->local_nls, |
2107 | cifs_sb->mnt_cifs_flags & | 2122 | cifs_sb->mnt_cifs_flags & |
2108 | CIFS_MOUNT_MAP_SPECIAL_CHR); | 2123 | CIFS_MOUNT_MAP_SPECIAL_CHR); |
2109 | kfree(volume_info.UNC); | 2124 | rc = -ENODEV; |
2110 | FreeXid(xid); | 2125 | goto out; |
2111 | return -ENODEV; | ||
2112 | } else { | 2126 | } else { |
2113 | /* BB Do we need to wrap sesSem around | 2127 | /* BB Do we need to wrap sesSem around |
2114 | * this TCon call and Unix SetFS as | 2128 | * this TCon call and Unix SetFS as |
@@ -2231,6 +2245,12 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb, | |||
2231 | (in which case it is not needed anymore) but when new sesion is created | 2245 | (in which case it is not needed anymore) but when new sesion is created |
2232 | the password ptr is put in the new session structure (in which case the | 2246 | the password ptr is put in the new session structure (in which case the |
2233 | password will be freed at unmount time) */ | 2247 | password will be freed at unmount time) */ |
2248 | out: | ||
2249 | /* zero out password before freeing */ | ||
2250 | if (volume_info.password != NULL) { | ||
2251 | memset(volume_info.password, 0, strlen(volume_info.password)); | ||
2252 | kfree(volume_info.password); | ||
2253 | } | ||
2234 | kfree(volume_info.UNC); | 2254 | kfree(volume_info.UNC); |
2235 | kfree(volume_info.prepath); | 2255 | kfree(volume_info.prepath); |
2236 | FreeXid(xid); | 2256 | FreeXid(xid); |
@@ -2374,7 +2394,7 @@ CIFSSessSetup(unsigned int xid, struct cifsSesInfo *ses, | |||
2374 | pSMB->req_no_secext.ByteCount = cpu_to_le16(count); | 2394 | pSMB->req_no_secext.ByteCount = cpu_to_le16(count); |
2375 | 2395 | ||
2376 | rc = SendReceive(xid, ses, smb_buffer, smb_buffer_response, | 2396 | rc = SendReceive(xid, ses, smb_buffer, smb_buffer_response, |
2377 | &bytes_returned, 1); | 2397 | &bytes_returned, CIFS_LONG_OP); |
2378 | if (rc) { | 2398 | if (rc) { |
2379 | /* rc = map_smb_to_linux_error(smb_buffer_response); now done in SendReceive */ | 2399 | /* rc = map_smb_to_linux_error(smb_buffer_response); now done in SendReceive */ |
2380 | } else if ((smb_buffer_response->WordCount == 3) | 2400 | } else if ((smb_buffer_response->WordCount == 3) |
@@ -2678,7 +2698,7 @@ CIFSNTLMSSPNegotiateSessSetup(unsigned int xid, | |||
2678 | pSMB->req.ByteCount = cpu_to_le16(count); | 2698 | pSMB->req.ByteCount = cpu_to_le16(count); |
2679 | 2699 | ||
2680 | rc = SendReceive(xid, ses, smb_buffer, smb_buffer_response, | 2700 | rc = SendReceive(xid, ses, smb_buffer, smb_buffer_response, |
2681 | &bytes_returned, 1); | 2701 | &bytes_returned, CIFS_LONG_OP); |
2682 | 2702 | ||
2683 | if (smb_buffer_response->Status.CifsError == | 2703 | if (smb_buffer_response->Status.CifsError == |
2684 | cpu_to_le32(NT_STATUS_MORE_PROCESSING_REQUIRED)) | 2704 | cpu_to_le32(NT_STATUS_MORE_PROCESSING_REQUIRED)) |
@@ -3105,7 +3125,7 @@ CIFSNTLMSSPAuthSessSetup(unsigned int xid, struct cifsSesInfo *ses, | |||
3105 | pSMB->req.ByteCount = cpu_to_le16(count); | 3125 | pSMB->req.ByteCount = cpu_to_le16(count); |
3106 | 3126 | ||
3107 | rc = SendReceive(xid, ses, smb_buffer, smb_buffer_response, | 3127 | rc = SendReceive(xid, ses, smb_buffer, smb_buffer_response, |
3108 | &bytes_returned, 1); | 3128 | &bytes_returned, CIFS_LONG_OP); |
3109 | if (rc) { | 3129 | if (rc) { |
3110 | /* rc = map_smb_to_linux_error(smb_buffer_response) done in SendReceive now */ | 3130 | /* rc = map_smb_to_linux_error(smb_buffer_response) done in SendReceive now */ |
3111 | } else if ((smb_buffer_response->WordCount == 3) || | 3131 | } else if ((smb_buffer_response->WordCount == 3) || |
@@ -3381,7 +3401,8 @@ CIFSTCon(unsigned int xid, struct cifsSesInfo *ses, | |||
3381 | pSMB->hdr.smb_buf_length += count; | 3401 | pSMB->hdr.smb_buf_length += count; |
3382 | pSMB->ByteCount = cpu_to_le16(count); | 3402 | pSMB->ByteCount = cpu_to_le16(count); |
3383 | 3403 | ||
3384 | rc = SendReceive(xid, ses, smb_buffer, smb_buffer_response, &length, 0); | 3404 | rc = SendReceive(xid, ses, smb_buffer, smb_buffer_response, &length, |
3405 | CIFS_STD_OP); | ||
3385 | 3406 | ||
3386 | /* if (rc) rc = map_smb_to_linux_error(smb_buffer_response); */ | 3407 | /* if (rc) rc = map_smb_to_linux_error(smb_buffer_response); */ |
3387 | /* above now done in SendReceive */ | 3408 | /* above now done in SendReceive */ |
@@ -3505,7 +3526,7 @@ cifs_umount(struct super_block *sb, struct cifs_sb_info *cifs_sb) | |||
3505 | sesInfoFree(ses); | 3526 | sesInfoFree(ses); |
3506 | 3527 | ||
3507 | FreeXid(xid); | 3528 | FreeXid(xid); |
3508 | return rc; /* BB check if we should always return zero here */ | 3529 | return rc; |
3509 | } | 3530 | } |
3510 | 3531 | ||
3511 | int cifs_setup_session(unsigned int xid, struct cifsSesInfo *pSesInfo, | 3532 | int cifs_setup_session(unsigned int xid, struct cifsSesInfo *pSesInfo, |