Commit 5adac19a authored by Changpeng Liu's avatar Changpeng Liu Committed by Ben Walker
Browse files

blobfs: return error to caller when loading a bs which isn't blobfs



Also release the IO channels with filesystem data structure.

Change-Id: I75a5d427fe4837ad7d85444d09ded9ab41e0ca8e
Signed-off-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464851


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
parent 62202dda
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -761,7 +761,8 @@ load_cb(void *ctx, struct spdk_blob_store *bs, int bserrno)
	if (bserrno != 0) {
		args->fn.fs_op_with_handle(args->arg, NULL, bserrno);
		free_fs_request(req);
		free(fs);
		spdk_fs_free_io_channels(fs);
		spdk_fs_io_device_unregister(fs);
		return;
	}

@@ -771,11 +772,12 @@ load_cb(void *ctx, struct spdk_blob_store *bs, int bserrno)
		SPDK_DEBUGLOG(SPDK_LOG_BLOB, "assigning bstype\n");
		spdk_bs_set_bstype(bs, blobfs_type);
	} else if (memcmp(&bstype, &blobfs_type, sizeof(bstype))) {
		SPDK_DEBUGLOG(SPDK_LOG_BLOB, "not blobfs\n");
		SPDK_ERRLOG("not blobfs\n");
		SPDK_LOGDUMP(SPDK_LOG_BLOB, "bstype", &bstype, sizeof(bstype));
		args->fn.fs_op_with_handle(args->arg, NULL, bserrno);
		args->fn.fs_op_with_handle(args->arg, NULL, -EINVAL);
		free_fs_request(req);
		free(fs);
		spdk_fs_free_io_channels(fs);
		spdk_fs_io_device_unregister(fs);
		return;
	}