[1/2] ploop: Disable ioctl(PLOOP_IOC_BALLOON)

Submitted by Kirill Tkhai on April 10, 2019, 9:18 a.m.

Details

Message ID 155488792417.22760.555010391122396960.stgit@localhost.localdomain
State New
Series "Series without cover letter"
Headers show

Commit Message

Kirill Tkhai April 10, 2019, 9:18 a.m.
This ioctl enters in discard maintaince mode
in hidden way. The discard logic is rewritten,
so we disable it.

v2: Leave entering into PLOOP_MNTN_BALLOON,
    since it protects ploop against entering
    another maintaince mode (grow, etc).

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
 drivers/block/ploop/dev.c |   16 ----------------
 1 file changed, 16 deletions(-)

Patch hide | download patch | download mbox

diff --git a/drivers/block/ploop/dev.c b/drivers/block/ploop/dev.c
index 815c74438dd6..949617d5b14f 100644
--- a/drivers/block/ploop/dev.c
+++ b/drivers/block/ploop/dev.c
@@ -4524,22 +4524,6 @@  static int ploop_balloon_ioc(struct ploop_device *plo, unsigned long arg)
 		return -EINVAL;
 
 	switch (plo->maintenance_type) {
-	case PLOOP_MNTN_DISCARD:
-		if (!test_bit(PLOOP_S_DISCARD_LOADED, &plo->state))
-			break;
-
-		ploop_quiesce(plo);
-		clear_bit(PLOOP_S_DISCARD_LOADED, &plo->state);
-		plo->maintenance_type = PLOOP_MNTN_FBLOADED;
-		ploop_fb_lost_range_init(plo->fbd, delta->io.alloc_head);
-		ploop_relax(plo);
-		/* fall through */
-	case PLOOP_MNTN_FBLOADED:
-	case PLOOP_MNTN_RELOC:
-		BUG_ON (!plo->fbd);
-		ctl.alloc_head = ploop_fb_get_alloc_head(plo->fbd);
-		ctl.level      = ploop_fb_get_freezed_level(plo->fbd);
-		break;
 	case PLOOP_MNTN_OFF:
 		if (ctl.inflate) {
 			if (delta->ops->id != PLOOP_FMT_PLOOP1)