Commit e133dcd8 authored by wuzhouhui's avatar wuzhouhui Committed by Jim Harris
Browse files

bdev/gpt: vbdev_gpt_examine: no need to read gpt if bdev is too small



Change-Id: I28f21649feae8022cd0f0afd5b01ae3ee2b3592e
Signed-off-by: default avatarwuzhouhui <wuzhouhui@kingsoft.com>
Reviewed-on: https://review.gerrithub.io/424618


Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent b98bbb18
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -384,7 +384,10 @@ vbdev_gpt_examine(struct spdk_bdev *bdev)
{
	int rc;

	if (g_gpt_disabled) {
	/* A bdev with fewer than 2 blocks cannot have a GPT. Block 0 has
	 * the MBR and block 1 has the GPT header.
	 */
	if (g_gpt_disabled || spdk_bdev_get_num_blocks(bdev) < 2) {
		spdk_bdev_module_examine_done(&gpt_if);
		return;
	}