Repository navigation
Commit d251ed2
Al Viro
ubifs: fix sget races
* allocate ubifs_info in ->mount(), fill it enough for sb_test() and
set ->s_fs_info to it in set() callback passed to sget().
* do *not* free it in ->put_super(); do that in ->kill_sb() after we'd
done kill_anon_super().
* don't free it in ubifs_fill_super() either - deactivate_locked_super()
done by caller when ubifs_fill_super() returns an error will take care
of that sucker.
* get rid of kludge with passing ubi to ubifs_fill_super() in ->s_fs_info;
we only need it in alloc_ubifs_info(), so ubifs_fill_super() will need
only ubifs_info. Which it will find in ->s_fs_info just fine, no need to
reassign anything...
As the result, sb_test() becomes safe to apply to all superblocks that
can be found by sget() (and a kludge with temporary use of ->s_fs_info
to store a pointer to very different structure goes away).
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>1 parent b1c27ab commit d251ed2
1 file changed
Lines changed: 30 additions & 24 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1848 | 1848 | | |
1849 | 1849 | | |
1850 | 1850 | | |
1851 | | - | |
1852 | 1851 | | |
1853 | 1852 | | |
1854 | 1853 | | |
| |||
2020 | 2019 | | |
2021 | 2020 | | |
2022 | 2021 | | |
2023 | | - | |
2024 | | - | |
| 2022 | + | |
2025 | 2023 | | |
2026 | 2024 | | |
2027 | 2025 | | |
2028 | | - | |
2029 | | - | |
2030 | | - | |
2031 | | - | |
2032 | 2026 | | |
2033 | 2027 | | |
2034 | 2028 | | |
2035 | 2029 | | |
2036 | 2030 | | |
2037 | | - | |
| 2031 | + | |
2038 | 2032 | | |
2039 | 2033 | | |
2040 | 2034 | | |
| |||
2100 | 2094 | | |
2101 | 2095 | | |
2102 | 2096 | | |
2103 | | - | |
2104 | | - | |
| 2097 | + | |
2105 | 2098 | | |
2106 | 2099 | | |
2107 | 2100 | | |
2108 | 2101 | | |
2109 | 2102 | | |
2110 | | - | |
| 2103 | + | |
2111 | 2104 | | |
2112 | 2105 | | |
2113 | | - | |
| 2106 | + | |
| 2107 | + | |
| 2108 | + | |
| 2109 | + | |
| 2110 | + | |
| 2111 | + | |
| 2112 | + | |
2114 | 2113 | | |
2115 | 2114 | | |
2116 | 2115 | | |
2117 | 2116 | | |
2118 | 2117 | | |
2119 | 2118 | | |
2120 | | - | |
| 2119 | + | |
2121 | 2120 | | |
2122 | 2121 | | |
2123 | 2122 | | |
| |||
2134 | 2133 | | |
2135 | 2134 | | |
2136 | 2135 | | |
2137 | | - | |
2138 | 2136 | | |
2139 | | - | |
| 2137 | + | |
| 2138 | + | |
| 2139 | + | |
| 2140 | + | |
| 2141 | + | |
| 2142 | + | |
| 2143 | + | |
2140 | 2144 | | |
2141 | | - | |
| 2145 | + | |
2142 | 2146 | | |
2143 | 2147 | | |
2144 | | - | |
| 2148 | + | |
2145 | 2149 | | |
2146 | 2150 | | |
2147 | 2151 | | |
2148 | 2152 | | |
2149 | | - | |
| 2153 | + | |
2150 | 2154 | | |
2151 | 2155 | | |
2152 | 2156 | | |
| |||
2155 | 2159 | | |
2156 | 2160 | | |
2157 | 2161 | | |
2158 | | - | |
2159 | | - | |
2160 | | - | |
2161 | | - | |
2162 | | - | |
2163 | 2162 | | |
2164 | 2163 | | |
2165 | 2164 | | |
| |||
2179 | 2178 | | |
2180 | 2179 | | |
2181 | 2180 | | |
| 2181 | + | |
| 2182 | + | |
| 2183 | + | |
| 2184 | + | |
| 2185 | + | |
| 2186 | + | |
| 2187 | + | |
2182 | 2188 | | |
2183 | 2189 | | |
2184 | 2190 | | |
2185 | 2191 | | |
2186 | | - | |
| 2192 | + | |
2187 | 2193 | | |
2188 | 2194 | | |
2189 | 2195 | | |
| |||
0 commit comments