Skip to content

Commit 7ad5039

Browse files
Javier Gonzálezaxboe
authored andcommitted
lightnvm: pblk: check for supported version
At this point, only 1.2 spec is supported, thus check for it. Also, since device-side L2P is only supported in the 1.2 spec, make sure to only check its value under 1.2. Signed-off-by: Javier González <javier@cnexlabs.com> Signed-off-by: Matias Bjørling <mb@lightnvm.io> Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent a294c19 commit 7ad5039

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

drivers/lightnvm/pblk-init.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1016,9 +1016,15 @@ static void *pblk_init(struct nvm_tgt_dev *dev, struct gendisk *tdisk,
10161016
struct pblk *pblk;
10171017
int ret;
10181018

1019-
if (dev->geo.dom & NVM_RSP_L2P) {
1019+
if (geo->version != NVM_OCSSD_SPEC_12) {
1020+
pr_err("pblk: OCSSD version not supported (%u)\n",
1021+
geo->version);
1022+
return ERR_PTR(-EINVAL);
1023+
}
1024+
1025+
if (geo->version == NVM_OCSSD_SPEC_12 && geo->dom & NVM_RSP_L2P) {
10201026
pr_err("pblk: host-side L2P table not supported. (%x)\n",
1021-
dev->geo.dom);
1027+
geo->dom);
10221028
return ERR_PTR(-EINVAL);
10231029
}
10241030

0 commit comments

Comments
 (0)