Skip to content

Commit c9e4bf6

Browse files
azatrafaeljw
authored andcommitted
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: 1e8c813 ("PM: hibernate: don't use early_lookup_bdev in resume_store") Signed-off-by: Azat Khuzhin <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> [ rjw: Subject edits ] Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 06c2afb commit c9e4bf6

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

kernel/power/hibernate.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1179,6 +1179,7 @@ static ssize_t resume_store(struct kobject *kobj, struct kobj_attribute *attr,
11791179
unsigned maj, min, offset;
11801180
char *p, dummy;
11811181

1182+
error = 0;
11821183
if (sscanf(name, "%u:%u%c", &maj, &min, &dummy) == 2 ||
11831184
sscanf(name, "%u:%u:%u:%c", &maj, &min, &offset,
11841185
&dummy) == 3) {

0 commit comments

Comments
 (0)