]> 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>
Fri, 23 Jun 2017 13:25:53 +0000 (15:25 +0200)
commita51be7457349b5924c36debd785414ac7d65b7e5
treed92bf490a0fe589c06fedc44faa3ab48f98487e1
parent84fdc19b3350e41ee63f9a583a9245977e9f572b
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