Skip to content
Commit abd4d558 authored by Don Zickus's avatar Don Zickus Committed by Tony Luck
Browse files

pstore: change mutex locking to spin_locks



pstore was using mutex locking to protect read/write access to the
backend plug-ins.  This causes problems when pstore is executed in
an NMI context through panic() -> kmsg_dump().

This patch changes the mutex to a spin_lock_irqsave then also checks to
see if we are in an NMI context.  If we are in an NMI and can't get the
lock, just print a message stating that and blow by the locking.

All this is probably a hack around the bigger locking problem but it
solves my current situation of trying to sleep in an NMI context.

Tested by loading the lkdtm module and executing a HARDLOCKUP which
will cause the machine to panic inside the nmi handler.

Signed-off-by: default avatarDon Zickus <dzickus@redhat.com>
Acked-by: default avatarMatthew Garrett <mjg@redhat.com>
Signed-off-by: default avatarTony Luck <tony.luck@intel.com>
parent 6dda9266
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment