X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=utils.c;h=03648db65dc153a0d469bfdeab590c2316ca8fe1;hb=e4797df6a9fac329fdb168f8fd6bf1925ead3c28;hp=13835051a1a5b45a2f9a29f2425d0a540912c1e3;hpb=bf1ac8305ab3f191d9345793b88c4f5ec691cb9b;p=platform%2Fupstream%2Fbtrfs-progs.git diff --git a/utils.c b/utils.c index 1383505..03648db 100644 --- a/utils.c +++ b/utils.c @@ -154,7 +154,7 @@ int test_uuid_unique(char *fs_uuid) blkid_dev dev = NULL; blkid_cache cache = NULL; - if (blkid_get_cache(&cache, 0) < 0) { + if (blkid_get_cache(&cache, NULL) < 0) { printf("ERROR: lblkid cache get failed\n"); return 1; } @@ -2463,7 +2463,7 @@ static int group_profile_devs_min(u64 flag) } int test_num_disk_vs_raid(u64 metadata_profile, u64 data_profile, - u64 dev_cnt, int mixed) + u64 dev_cnt, int mixed, int ssd) { u64 allowed = 0; @@ -2504,11 +2504,9 @@ int test_num_disk_vs_raid(u64 metadata_profile, u64 data_profile, return 1; } - if (!mixed && (data_profile & BTRFS_BLOCK_GROUP_DUP)) { - fprintf(stderr, - "ERROR: DUP for data is allowed only in mixed mode\n"); - return 1; - } + warning_on(!mixed && (data_profile & BTRFS_BLOCK_GROUP_DUP) && ssd, + "DUP may not actually lead to 2 copies on the device, see manual page"); + return 0; } @@ -2603,7 +2601,7 @@ int btrfs_scan_lblkid(void) if (btrfs_scan_done) return 0; - if (blkid_get_cache(&cache, 0) < 0) { + if (blkid_get_cache(&cache, NULL) < 0) { printf("ERROR: lblkid cache get failed\n"); return 1; }