[Devel] [PATCH] ploop: Add lockout on discard requests
Kirill Tkhai
ktkhai at virtuozzo.com
Fri May 24 14:15:34 MSK 2019
In case of ext4 sends discard, it prohibits to reuse
the discarded block in its internals. But in case of
direct using of the device, there is no such protection.
This patch implements it.
Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
drivers/block/ploop/dev.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/block/ploop/dev.c b/drivers/block/ploop/dev.c
index 36df41450c4d..fa87bfdd84bb 100644
--- a/drivers/block/ploop/dev.c
+++ b/drivers/block/ploop/dev.c
@@ -2459,7 +2459,8 @@ ploop_entry_request(struct ploop_request * preq)
if (delta == top_delta) {
/* Block exists in top delta. Good. */
if (plo->maintenance_type == PLOOP_MNTN_GROW ||
- plo->maintenance_type == PLOOP_MNTN_RELOC) {
+ plo->maintenance_type == PLOOP_MNTN_RELOC ||
+ preq->req_rw & REQ_DISCARD) {
spin_lock_irq(&plo->lock);
ploop_add_lockout(preq, 0);
spin_unlock_irq(&plo->lock);
More information about the Devel
mailing list