lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230731060957.GA30409@lst.de>
Date:   Mon, 31 Jul 2023 08:09:57 +0200
From:   Christoph Hellwig <hch@....de>
To:     chengming.zhou@...ux.dev
Cc:     axboe@...nel.dk, hch@....de, ming.lei@...hat.com,
        linux-block@...r.kernel.org, linux-kernel@...r.kernel.org,
        zhouchengming@...edance.com, hare@...e.de
Subject: Re: [PATCH v2 1/4] blk-flush: flush_rq should inherit first_rq's
 cmd_flags

On Tue, Jul 25, 2023 at 09:00:59PM +0800, chengming.zhou@...ux.dev wrote:
> From: Chengming Zhou <zhouchengming@...edance.com>
> 
> The cmd_flags in blk_kick_flush() should inherit the original request's
> cmd_flags, but the current code looks buggy to me:

Should it?  I know the code is kinda trying to do it, but does it really
make sense?  Adding Hannes who originally added this inheritance and
discussing the details below:

>  	flush_rq->cmd_flags = REQ_OP_FLUSH | REQ_PREFLUSH;
> -	flush_rq->cmd_flags |= (flags & REQ_DRV) | (flags & REQ_FAILFAST_MASK);
> +	flush_rq->cmd_flags |= (first_rq->cmd_flags & REQ_DRV) |
> +			       (first_rq->cmd_flags & REQ_FAILFAST_MASK);

Two cases here:

 1) REQ_FAILFAST_MASK:  I don't think this is actually set on flush request
    currently, and even if it was applying it to the flush that serves more
    than a single originating command seems wrong to me.
 2) REQ_DRV is only set by drivers that have seen a bio.  For dm this
    is used as REQ_DM_POLL_LIST which should never be set for a flush/fua
    request.  For nvme-mpath it is REQ_NVME_MPATH, which is set in the
    bio based driver and used for decision making in the I/O completion
    handler.  So I guess this one actually does need to get passed
    through.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ