diff options
author | Dimitri John Ledkov <xnox@ubuntu.com> | 2018-12-11 10:30:30 +1100 |
---|---|---|
committer | Dimitri John Ledkov <xnox@ubuntu.com> | 2018-12-11 10:30:30 +1100 |
commit | 59d2f4ec0b9dff7b56da34541dffd3e676adf584 (patch) | |
tree | 0f982d10b206f248f13de6ba48617e9bdae5e5f5 /image | |
parent | 3b9cf4c8cda0818e4d3f9892ece9f7d99de13b03 (diff) | |
parent | 5b162a39be9dec46a22c815f43fc337b920b4252 (diff) |
Update upstream source from tag 'upstream/4.19.1'
Update to upstream version '4.19.1'
with Debian dir 171bf4d92c150acf94e8e0a7633c4349c4e39ad6
Diffstat (limited to 'image')
-rw-r--r-- | image/main.c | 29 | ||||
-rw-r--r-- | image/metadump.h | 2 |
2 files changed, 20 insertions, 11 deletions
diff --git a/image/main.c b/image/main.c index 351c5a25..39d5265d 100644 --- a/image/main.c +++ b/image/main.c @@ -499,7 +499,8 @@ static int write_buffers(struct metadump_struct *md, u64 *next) } if (err) { - error("one of the threads failed: %s", strerror(-err)); + errno = -err; + error("one of the threads failed: %m"); goto out; } @@ -690,10 +691,12 @@ static int flush_pending(struct metadump_struct *md, int done) } if (md->num_items >= ITEMS_PER_CLUSTER || done) { ret = write_buffers(md, &start); - if (ret) - error("unable to write buffers: %s", strerror(-ret)); - else + if (ret) { + errno = -ret; + error("unable to write buffers: %m"); + } else { meta_cluster_init(md, start); + } } pthread_mutex_unlock(&md->mutex); return ret; @@ -2093,6 +2096,10 @@ static int fixup_devices(struct btrfs_fs_info *fs_info, u64 devid, cur_devid; int ret; + if (btrfs_super_log_root(fs_info->super_copy)) { + warning( + "log tree detected, its generation will not match superblock"); + } trans = btrfs_start_transaction(fs_info->tree_root, 1); if (IS_ERR(trans)) { error("cannot starting transaction %ld", PTR_ERR(trans)); @@ -2373,10 +2380,12 @@ static int update_disk_super_on_device(struct btrfs_fs_info *info, ret = pwrite64(fp, buf, BTRFS_SUPER_INFO_SIZE, BTRFS_SUPER_INFO_OFFSET); if (ret != BTRFS_SUPER_INFO_SIZE) { - if (ret < 0) - error("cannot write superblock: %s", strerror(ret)); - else + if (ret < 0) { + errno = ret; + error("cannot write superblock: %m"); + } else { error("cannot write superblock"); + } ret = -EIO; goto out; } @@ -2487,7 +2496,7 @@ int main(int argc, char *argv[]) } else { if (walk_trees || sanitize != SANITIZE_NONE || compress_level) { error( - "useing -w, -s, -c options for restore makes no sense"); + "using -w, -s, -c options for restore makes no sense"); usage_error++; } if (multi_devices && dev_cnt < 2) { @@ -2531,8 +2540,8 @@ int main(int argc, char *argv[]) if (create) { ret = check_mounted(source); if (ret < 0) { - warning("unable to check mount status of: %s", - strerror(-ret)); + errno = -ret; + warning("unable to check mount status of: %m"); } else if (ret) { warning("%s already mounted, results may be inaccurate", source); diff --git a/image/metadump.h b/image/metadump.h index b9275e95..8ace60f5 100644 --- a/image/metadump.h +++ b/image/metadump.h @@ -55,7 +55,7 @@ struct fs_chunk { u64 logical; u64 physical; /* - * physical_dup only store additonal physical for BTRFS_BLOCK_GROUP_DUP + * physical_dup only store additional physical for BTRFS_BLOCK_GROUP_DUP * currently restore only support single and DUP * TODO: modify this structure and the function related to this * structure for support RAID* |