Skip to content

Commit

Permalink
watchdog: move definition of 'watchdog_proc_mutex' outside of proc_do…
Browse files Browse the repository at this point in the history
…watchdog()

This series removes proc_dowatchdog().  Since multiple new functions need
the 'watchdog_proc_mutex' to serialize access to the watchdog parameters
in /proc/sys/kernel, move the mutex outside of any function.

Signed-off-by: Ulrich Obergfell <uobergfe@redhat.com>
Signed-off-by: Don Zickus <dzickus@redhat.com>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Ulrich Obergfell authored and Linus Torvalds committed Apr 14, 2015
1 parent a0c9cbb commit f54c227
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kernel/watchdog.c
Original file line number Diff line number Diff line change
Expand Up @@ -701,6 +701,8 @@ static int proc_watchdog_update(void)

}

static DEFINE_MUTEX(watchdog_proc_mutex);

/*
* proc handler for /proc/sys/kernel/nmi_watchdog,watchdog_thresh
*/
Expand All @@ -710,7 +712,6 @@ int proc_dowatchdog(struct ctl_table *table, int write,
{
int err, old_thresh, old_enabled;
bool old_hardlockup;
static DEFINE_MUTEX(watchdog_proc_mutex);

mutex_lock(&watchdog_proc_mutex);
old_thresh = ACCESS_ONCE(watchdog_thresh);
Expand Down

0 comments on commit f54c227

Please sign in to comment.