]> git.ipfire.org Git - thirdparty/util-linux.git/commit
wipefs: exit on failed erase
authorKarel Zak <kzak@redhat.com>
Wed, 21 Jun 2017 08:53:28 +0000 (10:53 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 21 Jun 2017 08:53:28 +0000 (10:53 +0200)
commit6f1507f135bce5ba7f318c44e05327ca14a0505a
tree95c9c076aeb6da10f154dd2ae5bd3a035ee2bd53
parent8c1979948c6a616d5e53ef693b4b123ec879441d
wipefs: exit on failed erase

The current behavior is to report error and continue, it seems strange:

# blockdev --setro /dev/sdc

# wipefs -a /dev/sdc
wipefs: /dev/sdc: failed to erase xfs magic string at offset 0x00000000: Operation not permitted
/dev/sdc: 4 bytes were erased at offset 0x00000000 (xfs): 58 46 53 42
                          ^^^^^^^^^^^
                           not true

The patch calls err() to exit.

Reported-by: Vratislav Podzimek <vpodzime@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
misc-utils/wipefs.c