Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4986a9f5 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "fix regression in "epoll: Keep a reference on files added to the check list""

parents 6a7c3e0c e2dab6ee
Loading
Loading
Loading
Loading
+7 −9
Original line number Diff line number Diff line
@@ -1750,7 +1750,7 @@ static int ep_loop_check_proc(void *priv, void *cookie, int call_nests)
			 * during ep_insert().
			 */
			if (list_empty(&epi->ffd.file->f_tfile_llink)) {
				get_file(epi->ffd.file);
				if (get_file_rcu(epi->ffd.file))
					list_add(&epi->ffd.file->f_tfile_llink,
						 &tfile_check_list);
			}
@@ -1948,10 +1948,8 @@ SYSCALL_DEFINE4(epoll_ctl, int, epfd, int, op, int, fd,
			mutex_lock(&epmutex);
			if (is_file_epoll(tf.file)) {
				error = -ELOOP;
				if (ep_loop_check(ep, tf.file) != 0) {
					clear_tfile_check_list();
				if (ep_loop_check(ep, tf.file) != 0)
					goto error_tgt_fput;
				}
			} else {
				get_file(tf.file);
				list_add(&tf.file->f_tfile_llink,
@@ -1980,8 +1978,6 @@ SYSCALL_DEFINE4(epoll_ctl, int, epfd, int, op, int, fd,
			error = ep_insert(ep, &epds, tf.file, fd, full_check);
		} else
			error = -EEXIST;
		if (full_check)
			clear_tfile_check_list();
		break;
	case EPOLL_CTL_DEL:
		if (epi)
@@ -2004,8 +2000,10 @@ SYSCALL_DEFINE4(epoll_ctl, int, epfd, int, op, int, fd,
	mutex_unlock(&ep->mtx);

error_tgt_fput:
	if (full_check)
	if (full_check) {
		clear_tfile_check_list();
		mutex_unlock(&epmutex);
	}

	fdput(tf);
error_fput: