io-uring.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Olivier Langlois <olivier@trillion01.com>
To: Jens Axboe <axboe@kernel.dk>,
	Pavel Begunkov <asml.silence@gmail.com>,
	Oleg Nesterov <oleg@redhat.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Ingo Molnar <mingo@redhat.com>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	io-uring@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH 2/3] io_uring: Clear TIF_NOTIFY_SIGNAL when cancelling requests
Date: Sun, 22 Aug 2021 17:05:59 -0400	[thread overview]
Message-ID: <76eef510a89966e04184893a3c53c6cc67b81579.1629655338.git.olivier@trillion01.com> (raw)
In-Reply-To: <cover.1629655338.git.olivier@trillion01.com>

It is a reasonable expectation from a function  to leave the task struct
in a clean state. During io_uring_try_cancel_requests TIF_NOTIFY_SIGNAL
can be set.  Make sure that it is cleared by replacing calls to
io_run_task_work with tracehook_notify_signal

Signed-off-by: Olivier Langlois <olivier@trillion01.com>
---
 fs/io_uring.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/io_uring.c b/fs/io_uring.c
index a2e20a6fbfed..a9c83a5fc9f1 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -9032,7 +9032,7 @@ static void io_uring_try_cancel_requests(struct io_ring_ctx *ctx,
 		ret |= io_poll_remove_all(ctx, task, cancel_all);
 		ret |= io_kill_timeouts(ctx, task, cancel_all);
 		if (task)
-			ret |= io_run_task_work();
+			ret |= tracehook_notify_signal();
 		if (!ret)
 			break;
 		cond_resched();
-- 
2.32.0


  parent reply	other threads:[~2021-08-22 21:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-22 21:05 [PATCH 0/3] coredump: io_uring: Cancel io_uring to avoid core truncation Olivier Langlois
2021-08-22 21:05 ` [PATCH 1/3] tracehook: Add a return value to tracehook_notify_signal Olivier Langlois
2021-08-22 21:05 ` Olivier Langlois [this message]
2021-08-22 21:06 ` [PATCH 3/3] coredump: cancel io_uring requests before dumping core Olivier Langlois

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=76eef510a89966e04184893a3c53c6cc67b81579.1629655338.git.olivier@trillion01.com \
    --to=olivier@trillion01.com \
    --cc=asml.silence@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=ebiederm@xmission.com \
    --cc=io-uring@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=oleg@redhat.com \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).