summaryrefslogtreecommitdiff
path: root/btrfs-corrupt-block.c
diff options
context:
space:
mode:
authorDimitri John Ledkov <xnox@ubuntu.com>2018-12-11 10:30:30 +1100
committerDimitri John Ledkov <xnox@ubuntu.com>2018-12-11 10:30:30 +1100
commit59d2f4ec0b9dff7b56da34541dffd3e676adf584 (patch)
tree0f982d10b206f248f13de6ba48617e9bdae5e5f5 /btrfs-corrupt-block.c
parent3b9cf4c8cda0818e4d3f9892ece9f7d99de13b03 (diff)
parent5b162a39be9dec46a22c815f43fc337b920b4252 (diff)
Update upstream source from tag 'upstream/4.19.1'
Update to upstream version '4.19.1' with Debian dir 171bf4d92c150acf94e8e0a7633c4349c4e39ad6
Diffstat (limited to 'btrfs-corrupt-block.c')
-rw-r--r--btrfs-corrupt-block.c14
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);