提交 3704e098 编写于 作者: J Javier González 提交者: Jens Axboe

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: NJavier González <javier@cnexlabs.com>
Signed-off-by: NMatias Bjørling <m@bjorling.me>
Signed-off-by: NJens Axboe <axboe@fb.com>
上级 bba7f40a
...@@ -174,8 +174,7 @@ static inline sector_t rrpc_get_sector(sector_t laddr) ...@@ -174,8 +174,7 @@ static inline sector_t rrpc_get_sector(sector_t laddr)
static inline int request_intersects(struct rrpc_inflight_rq *r, static inline int request_intersects(struct rrpc_inflight_rq *r,
sector_t laddr_start, sector_t laddr_end) sector_t laddr_start, sector_t laddr_end)
{ {
return (laddr_end >= r->l_start && laddr_end <= r->l_end) && return (laddr_end >= r->l_start) && (laddr_start <= r->l_end);
(laddr_start >= r->l_start && laddr_start <= r->l_end);
} }
static int __rrpc_lock_laddr(struct rrpc *rrpc, sector_t laddr, static int __rrpc_lock_laddr(struct rrpc *rrpc, sector_t laddr,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册