diff options
Diffstat (limited to 'btrfs-corrupt-block.c')
-rw-r--r-- | btrfs-corrupt-block.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/btrfs-corrupt-block.c b/btrfs-corrupt-block.c index 4fbea26c..ba467921 100644 --- a/btrfs-corrupt-block.c +++ b/btrfs-corrupt-block.c @@ -70,9 +70,9 @@ static int debug_corrupt_block(struct extent_buffer *eb, if (!copy || mirror_num == copy) { ret = read_extent_from_disk(eb, 0, eb->len); if (ret < 0) { - error("cannot read eb bytenr %llu: %s", - (unsigned long long)eb->dev_bytenr, - strerror(-ret)); + errno = -ret; + error("cannot read eb bytenr %llu: %m", + (unsigned long long)eb->dev_bytenr); return ret; } printf("corrupting %llu copy %d\n", eb->start, @@ -80,9 +80,9 @@ static int debug_corrupt_block(struct extent_buffer *eb, memset(eb->data, 0, eb->len); ret = write_extent_to_disk(eb); if (ret < 0) { - error("cannot write eb bytenr %llu: %s", - (unsigned long long)eb->dev_bytenr, - strerror(-ret)); + errno = -ret; + error("cannot write eb bytenr %llu: %m", + (unsigned long long)eb->dev_bytenr); return ret; } fsync(eb->fd); @@ -926,7 +926,7 @@ static int delete_csum(struct btrfs_root *root, u64 bytenr, u64 bytes) return PTR_ERR(trans); } - ret = btrfs_del_csums(trans, root, bytenr, bytes); + ret = btrfs_del_csums(trans, bytenr, bytes); if (ret) fprintf(stderr, "Error deleting csums %d\n", ret); btrfs_commit_transaction(trans, root); |