fix oops on cat /dev/snapshot
Subsystems (2)
What /dev/snapshot is simply cat-ed -- without ioctls used in normal operation -- it oopses. This one should fix it.
kernel/power/user.c +2 -0
@@ -99,6 +99,8 @@ssize_t res; data = filp->private_data; +if (!data->ready) +return -EINVAL ; res =snapshot_read_next (&data->handle, count);if (res >0 ) {if (copy_to_user (buf,data_of (data->handle), res))
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
kernel/power/user.c line 103
Quoted 13 lines · Pavel Machek
What
/dev/snapshotis simply cat-ed -- without ioctls used in normal operation -- it oopses. This one should fix it.Signed-off-by Pavel Machek <[email protected]>kernel/power/user.c +2
-0@@ -99,6 +99,8 @@ssize_t res; data = filp->private_data; +if (!data->ready) +return -EINVAL ;
I'd like to use -ENODATA here.
kernel/power/user.c line 106
Quoted 4 lines
kernel/power/user.c +0
-0res =snapshot_read_next (&data->handle, count);if (res >0 ) {if (copy_to_user (buf,data_of (data->handle), res))
I have a patch for that and I'm going to post it in a while if you don't mind.
I've already posted it once, here: http://lkml.org/lkml/2007/6/10/146
Greetings,
Rafael
Signature · 1 line
"Premature optimization is the root of all evil." - Donald Knuth
Hi!
Quoted 21 lines
kernel/power/user.c line 103
Quoted 13 lines
What
/dev/snapshotis simply cat-ed -- without ioctls used in normal operation -- it oopses. This one should fix it.Signed-off-by Pavel Machek <[email protected]>kernel/power/user.c +2
-0@@ -99,6 +99,8 @@ssize_t res; data = filp->private_data; +if (!data->ready) +return -EINVAL ;I'd like to use
-ENODATAhere.kernel/power/user.c line 106
Quoted 4 lines
kernel/power/user.c +0
-0res =snapshot_read_next (&data->handle, count);if (res >0 ) {if (copy_to_user (buf,data_of (data->handle), res))
Quoted 4 lines
I have a patch for that and I'm going to post it in a while if you don't mind.
I've already posted it once, here: http://lkml.org/lkml/2007/6/10/146
Aha, go ahead, I did not notice that mail.
Pavel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html