Bug 11726 - blockdev always returns 0
Summary: blockdev always returns 0
Status: RESOLVED WORKSFORME
Alias: None
Product: Busybox
Classification: Unclassified
Component: Other (show other bugs)
Version: 1.30.x
Hardware: All Linux
: P5 minor
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-03-14 00:47 UTC by Paul Whittaker
Modified: 2019-03-30 17:55 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Whittaker 2019-03-14 00:47:50 UTC
The blockdev applet always returns a zero exit code, which is not consistent with util-linux blockdev behaviour.

In particular, this is a problem for the "blockdev --rereadpt" case, which does not provide stdout output.  Automation may be relying on a non-zero exit code from blockdev to indicate a BLKRRPART ioctl failure.
Comment 1 Denys Vlasenko 2019-03-30 17:55:46 UTC
Can't reproduce:

busybox blockdev --rereadpt /dev/sda

execve("./busybox", ["./busybox", "blockdev", "--rereadpt", "/dev/sda"], 0x7ffdd1fbf4b8 /* 53 vars */) = 0
ioctl(0, TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(1, TCGETS, {B38400 opost isig icanon echo ...}) = 0
prctl(PR_SET_NAME, "busybox")           = 0
getuid32()                              = 0
open("/dev/sda", O_RDONLY|O_LARGEFILE)  = 3
ioctl(3, BLKRRPART)                     = -1 EBUSY (Device or resource busy)
write(2, "blockdev: /dev/sda: Device or resource busy\n", 44) = 44
exit(1)                                 = ?
+++ exited with 1 +++