mirror of
https://github.com/kdave/btrfs-progs
synced 2024-12-27 08:32:20 +00:00
btrfs-progs: mkfs: check blkid version on zoned filesystems
Prior to version 2.38, libblkid fails to detect zoned mode's superblock location resulting in blkid failing to detect btrfs on zoned block devices. This patch suggest to the user to upgrade libblkid if it detects a version lower then 2.38. Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
f5884fc8ca
commit
d8c6021727
@ -28,6 +28,7 @@
|
||||
#include <string.h>
|
||||
#include <pthread.h>
|
||||
#include <uuid/uuid.h>
|
||||
#include <blkid/blkid.h>
|
||||
#include "kernel-lib/list.h"
|
||||
#include "kernel-lib/list_sort.h"
|
||||
#include "kernel-lib/rbtree.h"
|
||||
@ -1346,6 +1347,8 @@ int BOX_MAIN(mkfs)(int argc, char **argv)
|
||||
exit(1);
|
||||
}
|
||||
if (opt_zoned) {
|
||||
const int blkid_version = blkid_get_library_version(NULL, NULL);
|
||||
|
||||
if (source_dir_set) {
|
||||
error("the option -r and zoned mode are incompatible");
|
||||
exit(1);
|
||||
@ -1360,6 +1363,9 @@ int BOX_MAIN(mkfs)(int argc, char **argv)
|
||||
error("cannot enable RAID5/6 in zoned mode");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (blkid_version < 2380)
|
||||
warning("libblkid < 2.38 does not support zoned mode's superblock location, update recommended");
|
||||
}
|
||||
|
||||
if (btrfs_check_nodesize(nodesize, sectorsize, &features))
|
||||
|
Loading…
Reference in New Issue
Block a user