New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 833528 link

Starred by 1 user

Issue metadata

Status: Verified
Owner:
Last visit > 30 days ago
Closed: Apr 2018
Cc:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug



Sign in to add a comment

Fix: "Process '/usr/bin/set_blkdev_pm' failed"

Project Member Reported by mka@chromium.org, Apr 16 2018

Issue description

b/74022675 reports "Process '/usr/bin/set_blkdev_pm' failed" in the system logs.

The messages are caused by an error in the set_blkdev_pm script, which doesn't take into account that the glob expression for block devices sdN ('/sys/block/sd[a-z]') returns the expression itself when no matches are found. With bash 'shopt -s nullglob' could be used to get an empty string instead, however dash doesn't provide 'shopt', so we have to handle this case differently.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Apr 18 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/06497f6af34bef0b9e792738b28760332a5567fa

commit 06497f6af34bef0b9e792738b28760332a5567fa
Author: Matthias Kaehlcke <mka@chromium.org>
Date: Wed Apr 18 09:07:58 2018

power: set_blkdev_pm: Handle no matches in glob expression

set_blkdev_pm uses globbing to iterate over block devices sdX and
doesn't take into account that the glob expression itself is returned
when no matches are found. As a result the system log contains
misleading error messages.

With bash 'shopt -s nullglob' could be used to have the glob return an
empty string instead, however dash doesn't provide 'shopt'. Instead
confirm that the block device path returned by the expression actually
exists before doing further processing.

BUG= chromium:833528 
TEST=run set_blkdev_pm on device without /dev/sdN
  => no error messages

Change-Id: I72a019316782aa7de7a556704b3b67e0b9aa1e0b
Reviewed-on: https://chromium-review.googlesource.com/1014346
Commit-Ready: Matthias Kaehlcke <mka@chromium.org>
Tested-by: Matthias Kaehlcke <mka@chromium.org>
Reviewed-by: Dan Erat <derat@chromium.org>

[modify] https://crrev.com/06497f6af34bef0b9e792738b28760332a5567fa/power_manager/udev/optional/set_blkdev_pm

Comment 2 by mka@chromium.org, Apr 18 2018

Labels: Merge-Request-67 M-67
Status: Verified (was: Started)
Labels: -Merge-Request-67 Merge-Approved-67
Approving merge to M67 Chrome OS.
Project Member

Comment 4 by bugdroid1@chromium.org, Apr 18 2018

Labels: merge-merged-release-R67-10575.B
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/efa70c1f6613e41701af6fdaa1e9c92411504b0f

commit efa70c1f6613e41701af6fdaa1e9c92411504b0f
Author: Matthias Kaehlcke <mka@chromium.org>
Date: Wed Apr 18 18:51:25 2018

power: set_blkdev_pm: Handle no matches in glob expression

set_blkdev_pm uses globbing to iterate over block devices sdX and
doesn't take into account that the glob expression itself is returned
when no matches are found. As a result the system log contains
misleading error messages.

With bash 'shopt -s nullglob' could be used to have the glob return an
empty string instead, however dash doesn't provide 'shopt'. Instead
confirm that the block device path returned by the expression actually
exists before doing further processing.

BUG= chromium:833528 
TEST=run set_blkdev_pm on device without /dev/sdN
  => no error messages

Change-Id: I72a019316782aa7de7a556704b3b67e0b9aa1e0b
Reviewed-on: https://chromium-review.googlesource.com/1014346
Commit-Ready: Matthias Kaehlcke <mka@chromium.org>
Tested-by: Matthias Kaehlcke <mka@chromium.org>
Reviewed-by: Dan Erat <derat@chromium.org>
(cherry picked from commit 06497f6af34bef0b9e792738b28760332a5567fa)
Reviewed-on: https://chromium-review.googlesource.com/1017500
Reviewed-by: Matthias Kaehlcke <mka@chromium.org>
Commit-Queue: Matthias Kaehlcke <mka@chromium.org>

[modify] https://crrev.com/efa70c1f6613e41701af6fdaa1e9c92411504b0f/power_manager/udev/optional/set_blkdev_pm

Project Member

Comment 5 by sheriffbot@chromium.org, Apr 23 2018

Cc: kbleicher@chromium.org
This issue has been approved for a merge. Please merge the fix to any appropriate branches as soon as possible!

If all merges have been completed, please remove any remaining Merge-Approved labels from this issue.

Thanks for your time! To disable nags, add the Disable-Nags label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Comment 6 by mka@chromium.org, Apr 23 2018

Labels: -Merge-Approved-67

Sign in to add a comment