[Devel] [vzlin-dev] [PATCH rh7] ploop: io_kaio: fix silly bug in kaio_complete_io_state()

Dmitry Monakhov dmonakhov at openvz.org
Fri Jun 17 01:51:25 PDT 2016


Maxim Patlasov <mpatlasov at virtuozzo.com> writes:

> It's useless to check for preq->req_rw & REQ_FUA after:
> preq->req_rw &= ~REQ_FUA;
ACK :) But in order to make it clear for others let's post original code
here!
...
      preq->req_rw &= ~REQ_FUA;

        /* Convert requested fua to fsync */
           if (test_and_clear_bit(PLOOP_REQ_FORCE_FUA, &preq->state) ||
                       test_and_clear_bit(PLOOP_REQ_KAIO_FSYNC,
           &preq->state))
                           post_fsync = 1;

        if (!post_fsync &&
                    !ploop_req_delay_fua_possible(preq->req_rw, preq) &&
                                (preq->req_rw & REQ_FUA))
                                                post_fsync = 1;

        preq->req_rw &= ~REQ_FUA;
...


>
> Signed-off-by: Maxim Patlasov <mpatlasov at virtuozzo.com>
> ---
>  drivers/block/ploop/io_kaio.c |    2 --
>  1 file changed, 2 deletions(-)
>
> diff --git a/drivers/block/ploop/io_kaio.c b/drivers/block/ploop/io_kaio.c
> index 79aa9af..de26319 100644
> --- a/drivers/block/ploop/io_kaio.c
> +++ b/drivers/block/ploop/io_kaio.c
> @@ -71,8 +71,6 @@ static void kaio_complete_io_state(struct ploop_request * preq)
>  		return;
>  	}
>  
> -	preq->req_rw &= ~REQ_FUA;
> -
>  	/* Convert requested fua to fsync */
>  	if (test_and_clear_bit(PLOOP_REQ_FORCE_FUA, &preq->state) ||
>  	    test_and_clear_bit(PLOOP_REQ_KAIO_FSYNC, &preq->state))
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 472 bytes
Desc: not available
URL: <http://lists.openvz.org/pipermail/devel/attachments/20160617/bb10ee90/attachment.sig>


More information about the Devel mailing list