summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarel Zak <kzak@redhat.com>2014-01-16 16:38:30 +0100
committerKarel Zak <kzak@redhat.com>2014-01-16 16:38:30 +0100
commitc93c20304ce544d2f8200540ccf25e08900b2e9d (patch)
tree1ab12bd528396ebac250e92048003f5e5c961b87
parent90faf9eb07e0b67745ab25c1ab3521631cca2f97 (diff)
downloadutil-linux-c93c20304ce544d2f8200540ccf25e08900b2e9d.tar.gz
libblkid: no more probe for btrfs backup superblock
* Linux kernel cares about the first superblock only * backup superblock are FS specific stuff and there is no reason to care about it in generic tools * the problem with broken btrfs utils has been already fixed (it was possible to use the utils on filesystem with erased primary superblok without any warning message). Signed-off-by: Karel Zak <kzak@redhat.com>
-rw-r--r--libblkid/src/blkid.h.in1
-rw-r--r--libblkid/src/blkidP.h3
-rw-r--r--libblkid/src/probe.c10
-rw-r--r--libblkid/src/superblocks/btrfs.c7
4 files changed, 2 insertions, 19 deletions
diff --git a/libblkid/src/blkid.h.in b/libblkid/src/blkid.h.in
index b10c2863..4f5fe2ae 100644
--- a/libblkid/src/blkid.h.in
+++ b/libblkid/src/blkid.h.in
@@ -329,7 +329,6 @@ extern blkid_parttable blkid_partlist_get_table(blkid_partlist ls);
extern blkid_partition blkid_partlist_get_partition(blkid_partlist ls, int n);
extern blkid_partition blkid_partlist_get_partition_by_partno(blkid_partlist ls, int n);
extern blkid_partition blkid_partlist_devno_to_partition(blkid_partlist ls, dev_t devno);
-extern blkid_partition blkid_partlist_get_partition_by_partno(blkid_partlist ls, int n);
extern blkid_parttable blkid_partition_get_table(blkid_partition par);
extern const char *blkid_partition_get_name(blkid_partition par);
diff --git a/libblkid/src/blkidP.h b/libblkid/src/blkidP.h
index 0bbf310a..4a968d91 100644
--- a/libblkid/src/blkidP.h
+++ b/libblkid/src/blkidP.h
@@ -224,9 +224,6 @@ struct blkid_struct_probe
/* private per-probing flags */
#define BLKID_PROBE_FL_IGNORE_PT (1 << 1) /* ignore partition table */
-#define BLKID_PROBE_FL_IGNORE_BACKUP (1 << 2) /* ignore backup superblocks or PT */
-
-extern int blkid_probe_ignore_backup(blkid_probe pr);
extern blkid_probe blkid_clone_probe(blkid_probe parent);
extern blkid_probe blkid_probe_get_wholedisk_probe(blkid_probe pr);
diff --git a/libblkid/src/probe.c b/libblkid/src/probe.c
index 4b0c9979..e20c61bb 100644
--- a/libblkid/src/probe.c
+++ b/libblkid/src/probe.c
@@ -934,7 +934,8 @@ int blkid_do_probe(blkid_probe pr)
*
* This function erases the current signature detected by @pr. The @pr has to
* be open in O_RDWR mode, BLKID_SUBLKS_MAGIC or/and BLKID_PARTS_MAGIC flags
- * has to be enabled.
+ * has to be enabled (if you want to errase also superblock with broken check
+ * sums then use BLKID_SUBLKS_BADCSUM too).
*
* After successful signature removing the @pr prober will be moved one step
* back and the next blkid_do_probe() call will again call previously called
@@ -1135,8 +1136,6 @@ int blkid_do_safeprobe(blkid_probe pr)
blkid_probe_start(pr);
- pr->prob_flags |= BLKID_PROBE_FL_IGNORE_BACKUP;
-
for (i = 0; i < BLKID_NCHAINS; i++) {
struct blkid_chain *chn;
@@ -1809,8 +1808,3 @@ void blkid_probe_use_wiper(blkid_probe pr, blkid_loff_t off, blkid_loff_t size)
blkid_probe_chain_reset_vals(pr, chn);
}
}
-
-int blkid_probe_ignore_backup(blkid_probe pr)
-{
- return pr && (pr->prob_flags & BLKID_PROBE_FL_IGNORE_BACKUP);
-}
diff --git a/libblkid/src/superblocks/btrfs.c b/libblkid/src/superblocks/btrfs.c
index 034683b4..434be34b 100644
--- a/libblkid/src/superblocks/btrfs.c
+++ b/libblkid/src/superblocks/btrfs.c
@@ -63,11 +63,6 @@ static int probe_btrfs(blkid_probe pr, const struct blkid_idmag *mag)
{
struct btrfs_super_block *bfs;
- if (mag->kboff > 64 && blkid_probe_ignore_backup(pr)) {
- DBG(LOWPROBE, blkid_debug("btrfs: found backup superblock, ignore"));
- return 1;
- }
-
bfs = blkid_probe_get_sb(pr, mag, struct btrfs_super_block);
if (!bfs)
return -1;
@@ -92,8 +87,6 @@ const struct blkid_idinfo btrfs_idinfo =
.magics =
{
{ .magic = "_BHRfS_M", .len = 8, .sboff = 0x40, .kboff = 64 },
- { .magic = "_BHRfS_M", .len = 8, .sboff = 0x40, .kboff = 64 * 1024 },
- { .magic = "_BHRfS_M", .len = 8, .sboff = 0x40, .kboff = 256 * 1024 * 1024 },
{ NULL }
}
};