diff options
author | Javier González <jg@lightnvm.io> | 2016-02-04 17:13:25 +0300 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2016-02-04 19:19:45 +0300 |
commit | 3704e098cc1a4c2cabcf4e1cfbbff38b4bfb1ea7 (patch) | |
tree | 83268aa2265eebd76afdb9b5b6b9afe5d9059cc3 /drivers/lightnvm/rrpc.h | |
parent | bba7f40a029c1e2966146e3a021b3deaf5639904 (diff) | |
download | linux-3704e098cc1a4c2cabcf4e1cfbbff38b4bfb1ea7.tar.xz |
lightnvm: fix request intersection locking in rrpc
This patch fixes an error on the calculation of intersecting logical
addresses; it contemplates the case where a new request including
several addresses intersects with a single locked address. This case is
typical when multiple pages are sent in a new request, while GC - which
at the moment sends one address at the time - is running.
Signed-off-by: Javier González <javier@cnexlabs.com>
Signed-off-by: Matias Bjørling <m@bjorling.me>
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers/lightnvm/rrpc.h')
-rw-r--r-- | drivers/lightnvm/rrpc.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/lightnvm/rrpc.h b/drivers/lightnvm/rrpc.h index b0277cbf93d6..f7b37336353f 100644 --- a/drivers/lightnvm/rrpc.h +++ b/drivers/lightnvm/rrpc.h @@ -174,8 +174,7 @@ static inline sector_t rrpc_get_sector(sector_t laddr) static inline int request_intersects(struct rrpc_inflight_rq *r, sector_t laddr_start, sector_t laddr_end) { - return (laddr_end >= r->l_start && laddr_end <= r->l_end) && - (laddr_start >= r->l_start && laddr_start <= r->l_end); + return (laddr_end >= r->l_start) && (laddr_start <= r->l_end); } static int __rrpc_lock_laddr(struct rrpc *rrpc, sector_t laddr, |