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

Submitted by Maxim Patlasov on Dec. 5, 2016, 10:50 p.m.

Details

Message ID 148097818921.7115.7040140651743145949.stgit@maxim-thinkpad
State New
Series "ploop: pio_nfs does not require PLOOP_REQ_ISSUE_FLUSH"
Headers show

Commit Message

Maxim Patlasov Dec. 5, 2016, 10:50 p.m.
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@virtuozzo.com>
---
 drivers/block/ploop/dev.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

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;