[Devel,rh7] ploop: pio_nfs does not require PLOOP_REQ_ISSUE_FLUSH

Submitted by Maxim Patlasov on Oct. 25, 2016, 4:48 p.m.

Details

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

Commit Message

Maxim Patlasov Oct. 25, 2016, 4:48 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.

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

Patch hide | download patch | download mbox

diff --git a/drivers/block/ploop/map.c b/drivers/block/ploop/map.c
index 715dc15..154a897 100644
--- a/drivers/block/ploop/map.c
+++ b/drivers/block/ploop/map.c
@@ -1113,9 +1113,11 @@  static void map_wb_complete_post_process(struct ploop_map *map,
 	 * (see dio_submit()). So fsync of EXT4 image doesnt help us.
 	 * We need to force sync of nullified blocks.
 	 */
-	preq->eng_io = &top_delta->io;
+	if (top_delta->io.ops->issue_flush) {
+		preq->eng_io = &top_delta->io;
+		set_bit(PLOOP_REQ_ISSUE_FLUSH, &preq->state);
+	}
 	BUG_ON(test_bit(PLOOP_REQ_POST_SUBMIT, &preq->state));
-	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);
 }

Comments

Konstantin Khorenko Nov. 28, 2016, 2:31 p.m.
Setting FLUSH code has been moved to ploop_entry_nullify_req() after
34c7bf175575f737c0e7a8fbbfce8ead3b642cbf ("ploop: ploop_grow must nullify holes")

and it does not evident that moving the fix accordingly is enough.

Please, confirm.


--
Best regards,

Konstantin Khorenko,
Virtuozzo Linux Kernel Team

On 10/25/2016 07:48 PM, Maxim Patlasov wrote:
> 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.
>
> Signed-off-by: Maxim Patlasov <mpatlasov@virtuozzo.com>
> ---
>  drivers/block/ploop/map.c |    6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/block/ploop/map.c b/drivers/block/ploop/map.c
> index 715dc15..154a897 100644
> --- a/drivers/block/ploop/map.c
> +++ b/drivers/block/ploop/map.c
> @@ -1113,9 +1113,11 @@ static void map_wb_complete_post_process(struct ploop_map *map,
>  	 * (see dio_submit()). So fsync of EXT4 image doesnt help us.
>  	 * We need to force sync of nullified blocks.
>  	 */
> -	preq->eng_io = &top_delta->io;
> +	if (top_delta->io.ops->issue_flush) {
> +		preq->eng_io = &top_delta->io;
> +		set_bit(PLOOP_REQ_ISSUE_FLUSH, &preq->state);
> +	}
>  	BUG_ON(test_bit(PLOOP_REQ_POST_SUBMIT, &preq->state));
> -	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);
>  }
>
> .
>