mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-28 05:12:49 +00:00
PM: hibernate: Fix writing maj:min to /sys/power/resume
resume_store() first calls lookup_bdev() and after tries to handle
maj:min, but it does not reset the error before, hence if you will write
maj:min you will get ENOENT:
# echo 259:2 >| /sys/power/resume
bash: echo: write error: No such file or directory
This also should fix hiberation via systemd, since it uses this way.
Fixes: 1e8c813b08
("PM: hibernate: don't use early_lookup_bdev in resume_store")
Signed-off-by: Azat Khuzhin <a3at.mail@gmail.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
[ rjw: Subject edits ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
parent
06c2afb862
commit
c9e4bf607d
1 changed files with 1 additions and 0 deletions
|
@ -1179,6 +1179,7 @@ static ssize_t resume_store(struct kobject *kobj, struct kobj_attribute *attr,
|
|||
unsigned maj, min, offset;
|
||||
char *p, dummy;
|
||||
|
||||
error = 0;
|
||||
if (sscanf(name, "%u:%u%c", &maj, &min, &dummy) == 2 ||
|
||||
sscanf(name, "%u:%u:%u:%c", &maj, &min, &offset,
|
||||
&dummy) == 3) {
|
||||
|
|
Loading…
Reference in a new issue