lib/ftl: fixed metadata pointer arithmetic

The current location of the metadata pointer should be calculated based
on the metadata size, not block size.

Change-Id: I90177557cf4e194cd77adfbfe1c5a6e0e6df7967
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/455921
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
Konrad Sztyber 2019-05-28 10:34:16 +02:00 committed by Jim Harris
parent 6550abbac1
commit e1dbe1c84c

View File

@ -398,7 +398,7 @@ ftl_io_get_md(const struct ftl_io *io)
return NULL;
}
return (char *)io->md + io->pos * FTL_BLOCK_SIZE;
return (char *)io->md + io->pos * io->dev->md_size;
}
struct ftl_io *