[Devel] [PATCH RHEL7 COMMIT] ploop: Prohibit discard ioctls

Konstantin Khorenko khorenko at virtuozzo.com
Thu Mar 28 12:37:40 MSK 2019


The commit is pushed to "branch-rh7-3.10.0-957.10.1.vz7.85.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-957.10.1.vz7.85.5
------>
commit 4e24acd7264c28304f68c6d1a1df482cbf34764b
Author: Kirill Tkhai <ktkhai at virtuozzo.com>
Date:   Thu Mar 28 12:37:39 2019 +0300

    ploop: Prohibit discard ioctls
    
    Prohibit maintaince mode related ioctls.
    
    Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
    
    =====================
    Patchset description:
    
    ploop: Discard with zeroing of ploop1 indexes support
    
    https://jira.sw.ru/browse/PSBM-92367
    https://pmc.acronis.com/browse/VSTOR-19972
    
    Kirill Tkhai (10):
          ploop: Export map defines to separate header file
          ploop: Make submit_alloc() return int value
          ploop: Introduce ploop_submit_alloc() helper
          ploop: Prohibit discard ioctls
          ploop: Prohibit PLOOP_IOC_UPDATE_INDEX on singular list
          ploop: Introduce data_off_in_clusters() helper
          ploop: Add .complete_merge method
          ploop: Zero indexes on discard
          ploop: Fallocate cluster in cached_submit() during hole reuse
          ploop: Populate and maintain holes bitmap
---
 drivers/block/ploop/dev.c     | 10 ++++++++++
 drivers/block/ploop/discard.c |  6 ++++++
 2 files changed, 16 insertions(+)

diff --git a/drivers/block/ploop/dev.c b/drivers/block/ploop/dev.c
index f8b9b0bcba78..11bc864a5679 100644
--- a/drivers/block/ploop/dev.c
+++ b/drivers/block/ploop/dev.c
@@ -4522,6 +4522,8 @@ static int ploop_freeblks_ioc(struct ploop_device *plo, unsigned long arg)
 	int i;
 	int rc = 0;
 
+	return -EINVAL;
+
 	if (list_empty(&plo->map.delta_list))
 		return -ENOENT;
 
@@ -4605,6 +4607,8 @@ static int ploop_fbget_ioc(struct ploop_device *plo, unsigned long arg)
 	struct ploop_freeblks_ctl ctl;
 	int rc = 0;
 
+	return -EINVAL;
+
 	if (list_empty(&plo->map.delta_list))
 		return -ENOENT;
 
@@ -4629,6 +4633,8 @@ static int ploop_fbfilter_ioc(struct ploop_device *plo, unsigned long arg)
 {
 	int rc = 0;
 
+	return -EINVAL;
+
 	if (plo->maintenance_type != PLOOP_MNTN_DISCARD ||
 	    !test_bit(PLOOP_S_DISCARD_LOADED, &plo->state))
 		return -EINVAL;
@@ -4716,6 +4722,8 @@ static void ploop_discard_restart(struct ploop_device *plo, int err)
 
 static int ploop_fbdrop_ioc(struct ploop_device *plo)
 {
+	return -EINVAL;
+
 	if (list_empty(&plo->map.delta_list))
 		return -ENOENT;
 
@@ -4742,6 +4750,8 @@ static int ploop_relocblks_ioc(struct ploop_device *plo, unsigned long arg)
 	int err = 0;
 	int n_free;
 
+	return -EINVAL;
+
 	if (list_empty(&plo->map.delta_list))
 		return -ENOENT;
 
diff --git a/drivers/block/ploop/discard.c b/drivers/block/ploop/discard.c
index 33122497b9c5..1920ab05e20b 100644
--- a/drivers/block/ploop/discard.c
+++ b/drivers/block/ploop/discard.c
@@ -17,6 +17,8 @@ int ploop_discard_init_ioc(struct ploop_device *plo)
 	struct ploop_freeblks_desc *fbd;
 	struct ploop_delta *delta = ploop_top_delta(plo);
 
+	return -EINVAL;
+
 	if (delta == NULL)
 		return -EINVAL;
 
@@ -52,6 +54,8 @@ int ploop_discard_fini_ioc(struct ploop_device *plo)
 	struct ploop_request *preq, *tmp;
 	LIST_HEAD(drop_list);
 
+	return -EINVAL;
+
 	if (!test_and_clear_bit(PLOOP_S_DISCARD, &plo->state))
 		return 0;
 
@@ -90,6 +94,8 @@ int ploop_discard_wait_ioc(struct ploop_device *plo)
 {
 	int err;
 
+	return -EINVAL;
+
 	if (!test_bit(PLOOP_S_DISCARD, &plo->state))
 		return 0;
 



More information about the Devel mailing list