|
@@ -99,6 +99,8 @@ static ssize_t snapshot_read(struct file *filp, char __user *buf,
|
|
|
ssize_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))
|
|
@@ -245,7 +247,7 @@ static int snapshot_ioctl(struct inode *inode, struct file *filp,
|
|
|
break;
|
|
|
|
|
|
case SNAPSHOT_UNFREEZE:
|
|
|
- if (!data->frozen)
|
|
|
+ if (!data->frozen || data->ready)
|
|
|
break;
|
|
|
mutex_lock(&pm_mutex);
|
|
|
thaw_processes();
|