Commit 8cfbe7e6 authored by Oleg Nesterov's avatar Oleg Nesterov Committed by Greg Kroah-Hartman

USB: g_file_storage: call allow_signal()

New changes in the signal-handling code require compensating changes
in g_file_storage.  This patch (as913) by Oleg Nesterov makes the
code use allow_signal() instead of sigprocmask().

From: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 18954864
...@@ -686,7 +686,6 @@ struct fsg_dev { ...@@ -686,7 +686,6 @@ struct fsg_dev {
int thread_wakeup_needed; int thread_wakeup_needed;
struct completion thread_notifier; struct completion thread_notifier;
struct task_struct *thread_task; struct task_struct *thread_task;
sigset_t thread_signal_mask;
int cmnd_size; int cmnd_size;
u8 cmnd[MAX_COMMAND_SIZE]; u8 cmnd[MAX_COMMAND_SIZE];
...@@ -3277,8 +3276,7 @@ static void handle_exception(struct fsg_dev *fsg) ...@@ -3277,8 +3276,7 @@ static void handle_exception(struct fsg_dev *fsg)
/* Clear the existing signals. Anything but SIGUSR1 is converted /* Clear the existing signals. Anything but SIGUSR1 is converted
* into a high-priority EXIT exception. */ * into a high-priority EXIT exception. */
for (;;) { for (;;) {
sig = dequeue_signal_lock(current, &fsg->thread_signal_mask, sig = dequeue_signal_lock(current, &current->blocked, &info);
&info);
if (!sig) if (!sig)
break; break;
if (sig != SIGUSR1) { if (sig != SIGUSR1) {
...@@ -3431,10 +3429,10 @@ static int fsg_main_thread(void *fsg_) ...@@ -3431,10 +3429,10 @@ static int fsg_main_thread(void *fsg_)
/* Allow the thread to be killed by a signal, but set the signal mask /* Allow the thread to be killed by a signal, but set the signal mask
* to block everything but INT, TERM, KILL, and USR1. */ * to block everything but INT, TERM, KILL, and USR1. */
siginitsetinv(&fsg->thread_signal_mask, sigmask(SIGINT) | allow_signal(SIGINT);
sigmask(SIGTERM) | sigmask(SIGKILL) | allow_signal(SIGTERM);
sigmask(SIGUSR1)); allow_signal(SIGKILL);
sigprocmask(SIG_SETMASK, &fsg->thread_signal_mask, NULL); allow_signal(SIGUSR1);
/* Arrange for userspace references to be interpreted as kernel /* Arrange for userspace references to be interpreted as kernel
* pointers. That way we can pass a kernel pointer to a routine * pointers. That way we can pass a kernel pointer to a routine
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment