Commit d6951822 authored by Daniel Verkamp's avatar Daniel Verkamp Committed by Ben Walker
Browse files

bdev/gpt: fix MBR start_lba endian conversion



The message printed when start_lba doesn't match the expected value
would print byte-swapped values on big-endian architectures.  On
little-endian architectures, the problem would not be noticeable, since
the conversion doesn't do anything.

Change-Id: I9e8d4485b5710f4333d04bb006bc204416c689cd
Signed-off-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/370730


Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
parent e5f5d980
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -208,10 +208,10 @@ spdk_gpt_check_mbr(struct spdk_gpt *gpt)
		return -1;
	}

	to_le32(&expected_start_lba, GPT_PRIMARY_PARTITION_TABLE_LBA);
	if (mbr->partitions[0].start_lba != expected_start_lba) {
	expected_start_lba = GPT_PRIMARY_PARTITION_TABLE_LBA;
	if (from_le32(&mbr->partitions[0].start_lba) != expected_start_lba) {
		SPDK_TRACELOG(SPDK_TRACE_GPT_PARSE, "start lba mismatch, provided=%u, expected=%u\n",
			      mbr->partitions[0].start_lba, expected_start_lba);
			      from_le32(&mbr->partitions[0].start_lba), expected_start_lba);
		return -1;
	}