Skip to content

Commit

Permalink
dm: use signal_pending_state() in dm_wait_for_completion()
Browse files Browse the repository at this point in the history
Use signal_pending_state() instead of open-coding it.  This patch does
not change any functionality but makes it possible to pass TASK_KILLABLE
as the second argument of dm_wait_for_completion().  See also commit
16882c1 ("sched: fix TASK_WAKEKILL vs SIGKILL race").

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>.
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
  • Loading branch information
Bart Van Assche authored and Mike Snitzer committed Sep 14, 2016
1 parent b48633f commit e3fabdf
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/md/dm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1954,8 +1954,7 @@ static int dm_wait_for_completion(struct mapped_device *md, long task_state)
if (!md_in_flight(md))
break;

if (task_state == TASK_INTERRUPTIBLE &&
signal_pending(current)) {
if (signal_pending_state(task_state, current)) {
r = -EINTR;
break;
}
Expand Down

0 comments on commit e3fabdf

Please sign in to comment.