Skip to content

Commit

Permalink
lightnvm: pblk: fix incorrect min_write_pgs
Browse files Browse the repository at this point in the history
The calculation of pblk->min_write_pgs should only use the optimal
write size attribute provided by the drive, it does not correlate to
the memory page size of the system, which can be smaller or larger
than the LBA size reported.

Signed-off-by: Matias Bjørling <[email protected]>
Reviewed-by: Javier González <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
MatiasBjorling authored and axboe committed Oct 9, 2018
1 parent afdc23c commit 8bbd45d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/lightnvm/pblk-init.c
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ static int pblk_core_init(struct pblk *pblk)
atomic64_set(&pblk->nr_flush, 0);
pblk->nr_flush_rst = 0;

pblk->min_write_pgs = geo->ws_opt * (geo->csecs / PAGE_SIZE);
pblk->min_write_pgs = geo->ws_opt;
max_write_ppas = pblk->min_write_pgs * geo->all_luns;
pblk->max_write_pgs = min_t(int, max_write_ppas, NVM_MAX_VLBA);
pblk_set_sec_per_write(pblk, pblk->min_write_pgs);
Expand Down

0 comments on commit 8bbd45d

Please sign in to comment.