mirror of
https://github.com/kdave/btrfs-progs
synced 2025-05-16 23:08:38 +00:00
btrfs-progs: improve error messages after failed wiping
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
2490de5da5
commit
230bb91aa8
7
utils.c
7
utils.c
@ -842,8 +842,11 @@ static int btrfs_wipe_existing_sb(int fd)
|
||||
|
||||
memset(buf, 0, len);
|
||||
ret = pwrite(fd, buf, len, offset);
|
||||
if (ret != len) {
|
||||
fprintf(stderr, "ERROR: cannot wipe existing superblock\n");
|
||||
if (ret < 0) {
|
||||
error("cannot wipe existing superblock: %s", strerror(errno));
|
||||
ret = -1;
|
||||
} else if (ret != len) {
|
||||
error("cannot wipe existing superblock: wrote %d of %zd", ret, len);
|
||||
ret = -1;
|
||||
}
|
||||
fsync(fd);
|
||||
|
Loading…
Reference in New Issue
Block a user