Skip to content
Commit 25f2f3da authored by Rafael J. Wysocki's avatar Rafael J. Wysocki Committed by Andi Kleen
Browse files

snapshot: Use pm_mutex for mutual exclusion



We can avoid taking the BKL in snapshot_ioctl() if pm_mutex is used to prevent
the ioctls from being executed concurrently.

In addition, although it is only possible to open /dev/snapshot once, the task
which has done that may spawn a child that will inherit the open descriptor,
so in theory they can call snapshot_write(), snapshot_read() and
snapshot_release() concurrently.  pm_mutex can also be used for mutual
exclusion in such cases.

Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: default avatarAndi Kleen <ak@linux.intel.com>
Acked-by: default avatarPavel Machek <pavel@suse.cz>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent 52d11025
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