Commit 38b34aca30ef1296bbc552505d80c69f274f0872
Committed by
James Bottomley
1 parent
ee5df628c1
Exists in
master
and in
39 other branches
[SCSI] fcoe: remove unnecessary module state check
The check of module state being MODULE_STATE_LIVE is no longer needed for the individual fcoe transport driver, e.g., fcoe.ko, as sysfs entries now go to libfcoe now, if it reaches fcoe.ko, it has to be already registered. The module state check for libfcoe will guard the possible race condition of sysfs being writable before module_init function is called and after module_exit. Signed-off-by: Yi Zou <yi.zou@intel.com> Tested-by: Ross Brattain <ross.b.brattain@intel.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Showing 1 changed file with 0 additions and 47 deletions Side-by-side Diff
drivers/scsi/fcoe/fcoe.c
... | ... | @@ -1783,17 +1783,6 @@ |
1783 | 1783 | int rc = 0; |
1784 | 1784 | |
1785 | 1785 | mutex_lock(&fcoe_config_mutex); |
1786 | -#ifdef CONFIG_FCOE_MODULE | |
1787 | - /* | |
1788 | - * Make sure the module has been initialized, and is not about to be | |
1789 | - * removed. Module paramter sysfs files are writable before the | |
1790 | - * module_init function is called and after module_exit. | |
1791 | - */ | |
1792 | - if (THIS_MODULE->state != MODULE_STATE_LIVE) { | |
1793 | - rc = -ENODEV; | |
1794 | - goto out_nodev; | |
1795 | - } | |
1796 | -#endif | |
1797 | 1786 | |
1798 | 1787 | rtnl_lock(); |
1799 | 1788 | fcoe = fcoe_hostlist_lookup_port(netdev); |
... | ... | @@ -1805,7 +1794,6 @@ |
1805 | 1794 | } else |
1806 | 1795 | rc = -ENODEV; |
1807 | 1796 | |
1808 | -out_nodev: | |
1809 | 1797 | mutex_unlock(&fcoe_config_mutex); |
1810 | 1798 | return rc; |
1811 | 1799 | } |
... | ... | @@ -1824,17 +1812,6 @@ |
1824 | 1812 | int rc = 0; |
1825 | 1813 | |
1826 | 1814 | mutex_lock(&fcoe_config_mutex); |
1827 | -#ifdef CONFIG_FCOE_MODULE | |
1828 | - /* | |
1829 | - * Make sure the module has been initialized, and is not about to be | |
1830 | - * removed. Module paramter sysfs files are writable before the | |
1831 | - * module_init function is called and after module_exit. | |
1832 | - */ | |
1833 | - if (THIS_MODULE->state != MODULE_STATE_LIVE) { | |
1834 | - rc = -ENODEV; | |
1835 | - goto out_nodev; | |
1836 | - } | |
1837 | -#endif | |
1838 | 1815 | rtnl_lock(); |
1839 | 1816 | fcoe = fcoe_hostlist_lookup_port(netdev); |
1840 | 1817 | rtnl_unlock(); |
... | ... | @@ -1844,7 +1821,6 @@ |
1844 | 1821 | else if (!fcoe_link_ok(fcoe->ctlr.lp)) |
1845 | 1822 | fcoe_ctlr_link_up(&fcoe->ctlr); |
1846 | 1823 | |
1847 | -out_nodev: | |
1848 | 1824 | mutex_unlock(&fcoe_config_mutex); |
1849 | 1825 | return rc; |
1850 | 1826 | } |
... | ... | @@ -1863,17 +1839,6 @@ |
1863 | 1839 | int rc = 0; |
1864 | 1840 | |
1865 | 1841 | mutex_lock(&fcoe_config_mutex); |
1866 | -#ifdef CONFIG_FCOE_MODULE | |
1867 | - /* | |
1868 | - * Make sure the module has been initialized, and is not about to be | |
1869 | - * removed. Module paramter sysfs files are writable before the | |
1870 | - * module_init function is called and after module_exit. | |
1871 | - */ | |
1872 | - if (THIS_MODULE->state != MODULE_STATE_LIVE) { | |
1873 | - rc = -ENODEV; | |
1874 | - goto out_nodev; | |
1875 | - } | |
1876 | -#endif | |
1877 | 1842 | rtnl_lock(); |
1878 | 1843 | fcoe = fcoe_hostlist_lookup_port(netdev); |
1879 | 1844 | if (!fcoe) { |
... | ... | @@ -1937,18 +1902,6 @@ |
1937 | 1902 | |
1938 | 1903 | mutex_lock(&fcoe_config_mutex); |
1939 | 1904 | rtnl_lock(); |
1940 | - | |
1941 | -#ifdef CONFIG_FCOE_MODULE | |
1942 | - /* | |
1943 | - * Make sure the module has been initialized, and is not about to be | |
1944 | - * removed. Module paramter sysfs files are writable before the | |
1945 | - * module_init function is called and after module_exit. | |
1946 | - */ | |
1947 | - if (THIS_MODULE->state != MODULE_STATE_LIVE) { | |
1948 | - rc = -ENODEV; | |
1949 | - goto out_nodev; | |
1950 | - } | |
1951 | -#endif | |
1952 | 1905 | |
1953 | 1906 | /* look for existing lport */ |
1954 | 1907 | if (fcoe_hostlist_lookup(netdev)) { |