[Devel] [PATCH] ploop: Prohibit discard in case of multi-delta case

Kirill Tkhai ktkhai at virtuozzo.com
Mon Mar 18 14:34:14 MSK 2019


We can't send discard in case of there are more than
on delta. Otherewise it is considered as REQ_WRITE
request and forces block allocation, which leads
to crash since bio list is NULL on discard.

Strange thing, crash dis -l shows me, that problem
address is on the bottoms branch of this function,
but really we go thru
delta && delta != top_delta && whole_block() branch.

https://jira.sw.ru/browse/PSBM-92785

Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
 drivers/block/ploop/dev.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/block/ploop/dev.c b/drivers/block/ploop/dev.c
index 6349f0d556be..26745d9fc81f 100644
--- a/drivers/block/ploop/dev.c
+++ b/drivers/block/ploop/dev.c
@@ -2548,6 +2548,9 @@ static bool ploop_can_issue_discard(struct ploop_device *plo,
 	if (test_bit(PLOOP_S_NO_FALLOC_DISCARD, &plo->state))
 		return false;
 
+	if (!list_is_singular(&plo->map.delta_list))
+		return false;
+
 	return whole_block(plo, preq);
 }
 



More information about the Devel mailing list