Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1727848
| From | Dmitry Torokhov <dmitry.torokhov@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 3/6] Input: uinput - allow FF requests to time out |
| Date | 2017-09-07 02:30 +0200 |
| Message-ID | <umSRI-HU-21@gated-at.bofh.it> (permalink) |
| References | <umSRI-HU-11@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Previously uinput force feedback requests waited for the userspace
indefinitely, which caused users to block when uinput server process
become unresponsive. Let's establish a 30 seconds deadline for servicing
upload and erase force feedback effect actions, so that users have a
chance to abort stuck requests.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
drivers/input/misc/uinput.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/input/misc/uinput.c b/drivers/input/misc/uinput.c
index 443151de90c6..c30704fa1a06 100644
--- a/drivers/input/misc/uinput.c
+++ b/drivers/input/misc/uinput.c
@@ -149,7 +149,11 @@ static int uinput_request_submit(struct uinput_device *udev,
if (retval)
goto out;
- wait_for_completion(&request->done);
+ if (!wait_for_completion_timeout(&request->done, 30 * HZ)) {
+ retval = -ETIMEDOUT;
+ goto out;
+ }
+
retval = request->retval;
out:
--
2.14.1.581.gf28d330327-goog
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 1/6] Input: uinput - avoid FF flush when destroying device Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2017-09-07 02:30 +0200 [PATCH 3/6] Input: uinput - allow FF requests to time out Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2017-09-07 02:30 +0200 [PATCH 4/6] Input: uinput - fix coding style in uinput_ioctl_handler() Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2017-09-07 02:30 +0200
csiph-web