[Devel] [PATCH vz7] ploop: pio_nfs does not require PLOOP_REQ_ISSUE_FLUSH (v2)

Maxim Patlasov mpatlasov at virtuozzo.com
Mon Dec 5 14:50:11 PST 2016


The flag was introduced for local case: if we modify local
block-device directly, bypassing ext4, we cannot rely on
fsync() and must flush the device explicitly. It is not the
case for pio_nfs, so it's not necessary to set
PLOOP_REQ_ISSUE_FLUSH.

The patch is important because pio_nfs doesn't provide
issue_flush method.

Changed in v2:
 - rebase: after 34c7bf1755 moved set_bit and nullifying submit into
   ploop_entry_nullify_req(), the patch to be applied to this new
   place.

Signed-off-by: Maxim Patlasov <mpatlasov at virtuozzo.com>
---
 drivers/block/ploop/dev.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/block/ploop/dev.c b/drivers/block/ploop/dev.c
index 26017eb..a15606d 100644
--- a/drivers/block/ploop/dev.c
+++ b/drivers/block/ploop/dev.c
@@ -2036,9 +2036,11 @@ ploop_entry_nullify_req(struct ploop_request *preq)
 	 * (see dio_submit()). So fsync of EXT4 image doesnt help us.
 	 * We need to force sync of nullified blocks.
 	 */
+	if (top_delta->io.ops->issue_flush) {
+		preq->eng_io = &top_delta->io;
+		set_bit(PLOOP_REQ_ISSUE_FLUSH, &preq->state);
+	}
 
-	preq->eng_io = &top_delta->io;
-	set_bit(PLOOP_REQ_ISSUE_FLUSH, &preq->state);
 	top_delta->io.ops->submit(&top_delta->io, preq, preq->req_rw,
 				  &sbl, preq->iblock, 1<<plo->cluster_log);
 	return 0;



More information about the Devel mailing list