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