Unified · Split
| @@ -2203,29 +2203,22 @@ int do_epoll_ctl(int epfd, int op, int fd, struct epoll_event *epds, · 2202 unmodified lines | |||
| 2203 | full_check = 1; | 2203 | full_check = 1; |
| 2204 | if (is_file_epoll(tf.file)) { | 2204 | if (is_file_epoll(tf.file)) { |
| 2205 | error = -ELOOP; | 2205 | error = -ELOOP; |
| 2206 | if (ep_loop_check(ep, tf.file) != 0) { | 2206 | if (ep_loop_check(ep, tf.file) != 0) |
| 2207 | clear_tfile_check_list(); | ||
| 2208 | goto error_tgt_fput; | 2207 | goto error_tgt_fput; |
| 2209 | } | ||
| 2210 | } else { | 2208 | } else { |
| 2211 | get_file(tf.file); | 2209 | get_file(tf.file); |
| 2212 | list_add(&tf.file->f_tfile_llink, | 2210 | list_add(&tf.file->f_tfile_llink, |
| 2213 | &tfile_check_list); | 2211 | &tfile_check_list); |
| 2214 | } | 2212 | } |
| 2215 | error = epoll_mutex_lock(&ep->mtx, 0, nonblock); | 2213 | error = epoll_mutex_lock(&ep->mtx, 0, nonblock); |
| 2216 | if (error) { | 2214 | if (error) |
| 2217 | out_del: | ||
| 2218 | list_del(&tf.file->f_tfile_llink); | ||
| 2219 | if (!is_file_epoll(tf.file)) | ||
| 2220 | fput(tf.file); | ||
| 2221 | goto error_tgt_fput; | 2215 | goto error_tgt_fput; |
| 2222 | } | ||
| 2223 | if (is_file_epoll(tf.file)) { | 2216 | if (is_file_epoll(tf.file)) { |
| 2224 | tep = tf.file->private_data; | 2217 | tep = tf.file->private_data; |
| 2225 | error = epoll_mutex_lock(&tep->mtx, 1, nonblock); | 2218 | error = epoll_mutex_lock(&tep->mtx, 1, nonblock); |
| 2226 | if (error) { | 2219 | if (error) { |
| 2227 | mutex_unlock(&ep->mtx); | 2220 | mutex_unlock(&ep->mtx); |
| 2228 | goto out_del; | 2221 | goto error_tgt_fput; |
| 2229 | } | 2222 | } |
| 2230 | } | 2223 | } |
| 2231 | } | 2224 | } |
| @@ -2246,8 +2239,6 @@ out_del: · 14 unmodified lines | |||
| 2246 | error = ep_insert(ep, epds, tf.file, fd, full_check); | 2239 | error = ep_insert(ep, epds, tf.file, fd, full_check); |
| 2247 | } else | 2240 | } else |
| 2248 | error = -EEXIST; | 2241 | error = -EEXIST; |
| 2249 | if (full_check) | ||
| 2250 | clear_tfile_check_list(); | ||
| 2251 | break; | 2242 | break; |
| 2252 | case EPOLL_CTL_DEL: | 2243 | case EPOLL_CTL_DEL: |
| 2253 | if (epi) | 2244 | if (epi) |
| @@ -2270,8 +2261,10 @@ out_del: · 16 unmodified lines | |||
| 2270 | mutex_unlock(&ep->mtx); | 2261 | mutex_unlock(&ep->mtx); |
| 2271 | 2262 | ||
| 2272 | error_tgt_fput: | 2263 | error_tgt_fput: |
| 2273 | if (full_check) | 2264 | if (full_check) { |
| 2265 | clear_tfile_check_list(); | ||
| 2274 | mutex_unlock(&epmutex); | 2266 | mutex_unlock(&epmutex); |
| 2267 | } | ||
| 2275 | 2268 | ||
| 2276 | fdput(tf); | 2269 | fdput(tf); |
| 2277 | error_fput: | 2270 | error_fput: |