All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] n_tty: fix redirected_tty_write checks after write_iter conversion
@ 2021-01-25 19:09 Sami Tolvanen
  2021-01-25 19:27 ` Linus Torvalds
  0 siblings, 1 reply; 8+ messages in thread
From: Sami Tolvanen @ 2021-01-25 19:09 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Jiri Slaby
  Cc: Linus Torvalds, linux-kernel, Sami Tolvanen

Commit 9bb48c82aced ("tty: implement write_iter") converted the tty
layer to use write_iter. Fix the redirected_tty_write declaration
also in n_tty and change the comparisons to use write_iter instead of
write.

Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
---
 drivers/tty/n_tty.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c
index 319d68c8a5df..ee70937ac2b8 100644
--- a/drivers/tty/n_tty.c
+++ b/drivers/tty/n_tty.c
@@ -2081,8 +2081,7 @@ static int canon_copy_from_read_buf(struct tty_struct *tty,
 	return 0;
 }
 
-extern ssize_t redirected_tty_write(struct file *, const char __user *,
-							size_t, loff_t *);
+extern ssize_t redirected_tty_write(struct kiocb *, struct iov_iter *);
 
 /**
  *	job_control		-	check job control
@@ -2105,7 +2104,7 @@ static int job_control(struct tty_struct *tty, struct file *file)
 	/* NOTE: not yet done after every sleep pending a thorough
 	   check of the logic of this change. -- jlc */
 	/* don't stop on /dev/console */
-	if (file->f_op->write == redirected_tty_write)
+	if (file->f_op->write_iter == redirected_tty_write)
 		return 0;
 
 	return __tty_check_change(tty, SIGTTIN);
@@ -2309,7 +2308,7 @@ static ssize_t n_tty_write(struct tty_struct *tty, struct file *file,
 	ssize_t retval = 0;
 
 	/* Job control check -- must be done at start (POSIX.1 7.1.1.4). */
-	if (L_TOSTOP(tty) && file->f_op->write != redirected_tty_write) {
+	if (L_TOSTOP(tty) && file->f_op->write_iter != redirected_tty_write) {
 		retval = tty_check_change(tty);
 		if (retval)
 			return retval;

base-commit: 6ee1d745b7c9fd573fba142a2efdad76a9f1cb04
-- 
2.30.0.280.ga3ce27912f-goog


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-01-26 10:16 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-25 19:09 [PATCH] n_tty: fix redirected_tty_write checks after write_iter conversion Sami Tolvanen
2021-01-25 19:27 ` Linus Torvalds
2021-01-25 19:45   ` Linus Torvalds
2021-01-25 19:52     ` Greg Kroah-Hartman
2021-01-25 20:31       ` Linus Torvalds
2021-01-25 20:03     ` Sami Tolvanen
2021-01-25 20:08       ` Linus Torvalds
2021-01-25 20:40         ` Sami Tolvanen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.