Commit a16816b9 authored by Igor Konopko's avatar Igor Konopko Committed by Jens Axboe

lightnvm: disable interleaved metadata

Currently pblk only check the size of I/O metadata and does not take
into account if this metadata is in a separate buffer or interleaved
in a single metadata buffer.

In reality only the first scenario is supported, where second mode will
break pblk functionality during any IO operation.

This patch prevents pblk to be instantiated in case device only
supports interleaved metadata.
Reviewed-by: default avatarJavier González <javier@cnexlabs.com>
Signed-off-by: default avatarIgor Konopko <igor.j.konopko@intel.com>
Signed-off-by: default avatarMatias Bjørling <mb@lightnvm.io>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 24828d05
...@@ -1175,6 +1175,12 @@ static void *pblk_init(struct nvm_tgt_dev *dev, struct gendisk *tdisk, ...@@ -1175,6 +1175,12 @@ static void *pblk_init(struct nvm_tgt_dev *dev, struct gendisk *tdisk,
return ERR_PTR(-EINVAL); return ERR_PTR(-EINVAL);
} }
if (geo->ext) {
pblk_err(pblk, "extended metadata not supported\n");
kfree(pblk);
return ERR_PTR(-EINVAL);
}
spin_lock_init(&pblk->resubmit_lock); spin_lock_init(&pblk->resubmit_lock);
spin_lock_init(&pblk->trans_lock); spin_lock_init(&pblk->trans_lock);
spin_lock_init(&pblk->lock); spin_lock_init(&pblk->lock);
......
...@@ -990,6 +990,7 @@ int nvme_nvm_register(struct nvme_ns *ns, char *disk_name, int node) ...@@ -990,6 +990,7 @@ int nvme_nvm_register(struct nvme_ns *ns, char *disk_name, int node)
geo = &dev->geo; geo = &dev->geo;
geo->csecs = 1 << ns->lba_shift; geo->csecs = 1 << ns->lba_shift;
geo->sos = ns->ms; geo->sos = ns->ms;
geo->ext = ns->ext;
dev->q = q; dev->q = q;
memcpy(dev->name, disk_name, DISK_NAME_LEN); memcpy(dev->name, disk_name, DISK_NAME_LEN);
......
...@@ -357,6 +357,7 @@ struct nvm_geo { ...@@ -357,6 +357,7 @@ struct nvm_geo {
u32 clba; /* sectors per chunk */ u32 clba; /* sectors per chunk */
u16 csecs; /* sector size */ u16 csecs; /* sector size */
u16 sos; /* out-of-band area size */ u16 sos; /* out-of-band area size */
bool ext; /* metadata in extended data buffer */
/* device write constrains */ /* device write constrains */
u32 ws_min; /* minimum write size */ u32 ws_min; /* minimum write size */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment