[rh7] ploop: Add comment about S_SWAPFILE

Submitted by Kirill Tkhai on July 4, 2019, 9:46 a.m.

Details

Message ID 156223356774.15922.12265213794646044038.stgit@localhost.localdomain
State New
Series "ploop: Add comment about S_SWAPFILE"
Headers show

Commit Message

Kirill Tkhai July 4, 2019, 9:46 a.m.
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);