lightnvm: pblk: prevent premature sync point resets
authorHans Holmberg <hans.holmberg@cnexlabs.com>
Fri, 5 Jan 2018 13:16:11 +0000 (14:16 +0100)
committerJens Axboe <axboe@kernel.dk>
Fri, 5 Jan 2018 15:50:12 +0000 (08:50 -0700)
commitb36bbf9d4f731269b4fe88e1060af1e8c28b7972
treecb8027e0f3bb2ad1bdf293f7e243f4e8fa1e4f7d
parent533657c190e5a94e585e08d1c4bdd2295c76391a
lightnvm: pblk: prevent premature sync point resets

Unless we protect flush pointer updates with a lock, we risk
resetting new flush points before we've synced all sectors
up to that point.

This patch protects new flush points with the same spin lock
that is being held when advancing the sync pointer and
resetting completed flush points.

Signed-off-by: Hans Holmberg <hans.holmberg@cnexlabs.com>
Signed-off-by: Javier González <javier@cnexlabs.com>
Signed-off-by: Matias Bjørling <m@bjorling.me>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/lightnvm/pblk-rb.c