[RHEL7,COMMIT] ploop: Add comment about S_SWAPFILE

Submitted by Konstantin Khorenko on July 5, 2019, 8:09 a.m.

Details

Message ID 201907050809.x6589j8m011108@finist-ce7.sw.ru
State New
Series "ploop: Add comment about S_SWAPFILE"
Headers show

Commit Message

Konstantin Khorenko July 5, 2019, 8:09 a.m.
The commit is pushed to "branch-rh7-3.10.0-957.21.3.vz7.106.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-957.21.3.vz7.106.4
------>
commit 767d09a35bc02270a56255e8095d9a3fbb4e6ccd
Author: Kirill Tkhai <ktkhai@virtuozzo.com>
Date:   Fri Jul 5 11:09:45 2019 +0300

    ploop: Add comment about S_SWAPFILE
    
    Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
 drivers/block/ploop/io_direct_map.c | 4 ++++
 1 file changed, 4 insertions(+)

Patch hide | download patch | download mbox

diff --git a/drivers/block/ploop/io_direct_map.c b/drivers/block/ploop/io_direct_map.c
index a64cc43dfa3c..83b83027c013 100644
--- a/drivers/block/ploop/io_direct_map.c
+++ b/drivers/block/ploop/io_direct_map.c
@@ -111,6 +111,10 @@  ploop_dio_open(struct ploop_io * io, int rdonly)
 	pm->extent_root.mapping = mapping;
 	pm->readers = rdonly ? 1 : -1;
 	list_add(&pm->list, &ploop_mappings);
+	/*
+	 * This protects against EXT4_IOC_MOVE_EXT:
+	 * image file extents remain on the place.
+	 */
 	mapping->host->i_flags |= S_SWAPFILE;
 	io->size_ptr = &pm->size;
 	*io->size_ptr = i_size_read(mapping->host);