[Devel] [PATCH RHEL7 COMMIT] ploop: Prohibit PLOOP_IOC_UPDATE_INDEX on singular list

Konstantin Khorenko khorenko at virtuozzo.com
Thu Mar 28 12:37:41 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 17042e7b7c70ffd84433e3ac14d283738e58c3f7
Author: Kirill Tkhai <ktkhai at virtuozzo.com>
Date:   Thu Mar 28 12:37:39 2019 +0300

    ploop: Prohibit PLOOP_IOC_UPDATE_INDEX on singular list
    
    Add debug check to not miss a moment userspace
    decides to change its behavior.
    
    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 | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/block/ploop/dev.c b/drivers/block/ploop/dev.c
index 11bc864a5679..57920a93129a 100644
--- a/drivers/block/ploop/dev.c
+++ b/drivers/block/ploop/dev.c
@@ -4277,7 +4277,14 @@ static int ploop_index_update_ioc(struct ploop_device *plo, unsigned long arg)
 	struct reloc_map *map;
 	int i;
 
-	if (list_empty(&plo->map.delta_list))
+	/*
+	 * Currently this is used by userspace for relocation
+	 * of start blocks before expanding BAT of !top delta.
+	 * In case of someone wants to do that on a singular
+	 * list, he should expand holes bitmap too.
+	 */
+	if (list_empty(&plo->map.delta_list) ||
+	    list_is_singular(&plo->map.delta_list))
 		return -ENOENT;
 
 	if (copy_from_user(&ctl, (void*)arg,



More information about the Devel mailing list