swsusp: Fix userland interface
Subsystems (2)
PATCH 1/1 swsusp: Fix userland interface
[2.6.22 candidate, IMHO]
---
From: Rafael J. Wysocki <[email protected]>
Fix oops caused by 'cat /dev/snapshot', reported by Arkadiusz Miskiewicz, and make it impossible to thaw tasks with the help of the swsusp userland interface while there is a snapshot image ready to save.
Signed-off-by Rafael J. Wysocki <[email protected]>
--- kernel/power/user.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
kernel/power/user.c +3 -1
@@ -99,6 +99,8 @@ static ssize_t snapshot_read(struct filessize_t res; data = filp->private_data; +if (!data->ready) +return -ENODATA ; res =snapshot_read_next (&data->handle, count);if (res >0 ) {if (copy_to_user (buf,data_of (data->handle), res))
@@ -163,7 +165,7 @@ static int snapshot_ioctl(struct inode *break ;case SNAPSHOT_UNFREEZE : -if (!data->frozen) +if (!data->frozen || data->ready)break ;mutex_lock (&pm_mutex);thaw_processes ();
Hi!
Quoted 1 line
[2.6.22 candidate, IMHO]
It is trivial enough that it can go there, yes. But it is not a regression neither it is particulary serious.
Quoted 8 lines
---
From: Rafael J. Wysocki <[email protected]>Fix oops caused by 'cat
/dev/snapshot', reported by Arkadiusz Miskiewicz, and make it impossible to thaw tasks with the help of the swsusp userland interface while there is a snapshot image ready to save.Signed-off-by Rafael J. Wysocki <[email protected]>
ACK.
Pavel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html