提交 f824a2af 编写于 作者: J Joe Thornber 提交者: Mike Snitzer

dm cache: fix spurious cell_defer when dealing with partial block at end of device

We never bother caching a partial block that is at the back end of the
origin device.  No cell ever gets locked, but the calling code was
assuming it was and trying to release it.

Now the code only releases if the cell has been set to a non NULL
value.
Signed-off-by: NJoe Thornber <ejt@redhat.com>
Signed-off-by: NMike Snitzer <snitzer@redhat.com>
Cc: stable@vger.kernel.org
上级 1e32134a
...@@ -2690,11 +2690,11 @@ static int __cache_map(struct cache *cache, struct bio *bio, struct dm_bio_priso ...@@ -2690,11 +2690,11 @@ static int __cache_map(struct cache *cache, struct bio *bio, struct dm_bio_priso
static int cache_map(struct dm_target *ti, struct bio *bio) static int cache_map(struct dm_target *ti, struct bio *bio)
{ {
int r; int r;
struct dm_bio_prison_cell *cell; struct dm_bio_prison_cell *cell = NULL;
struct cache *cache = ti->private; struct cache *cache = ti->private;
r = __cache_map(cache, bio, &cell); r = __cache_map(cache, bio, &cell);
if (r == DM_MAPIO_REMAPPED) { if (r == DM_MAPIO_REMAPPED && cell) {
inc_ds(cache, bio, cell); inc_ds(cache, bio, cell);
cell_defer(cache, cell, false); cell_defer(cache, cell, false);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册