Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp4665202rwb; Mon, 31 Jul 2023 10:11:05 -0700 (PDT) X-Google-Smtp-Source: APBJJlFT1BjClSf4Kj2MJUFguPV2uH1X1+EeUPyD42iKApfAdGxg9jASyVmAMxY3tvEvCDrrQjdm X-Received: by 2002:a05:6a20:415:b0:137:2213:9495 with SMTP id a21-20020a056a20041500b0013722139495mr8746429pza.58.1690823465467; Mon, 31 Jul 2023 10:11:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690823465; cv=none; d=google.com; s=arc-20160816; b=gkBfeNRTqv5v9QJaRsnk71dI5LNN8kfNXySBteF4md+1eOBU0MC1V+7JkPZeWXvSXy ej7mVsyfeImO9ejonTYQeIQpqwJhtWnMj13WjkIkQwf3f+QW1xWheNXmrsd5MgbpHcEB u/qmgfTZVJxg73Zco7/1h9YvtnNJrrBIVlNEUs3QhpDcjSghyHxGzQkn7ge01+6L3w7N tQJSxgYbW4J42olwtL3HhfaLgwAW2wn2dyNRlzoZuIGGAep3BqUgG10YpSDF7tQUZr5K bllrasjGx3RKYChi6owYX55GHH4x11UdaOZeQlSq4fExRSfqLa6kMW0rs/22YRZjqzTG 8KHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature:dkim-signature; bh=kvhqVbeDEmUV6PN2wba2FNyJnxnf3msKSymDgqRJ+yw=; fh=xgN4HYklR6wLTdEU5sTNirmZdcVfFmMTyeDoN8rNrnA=; b=ru+mNsevvAsyCpU3u8R1Zvf5/mqytK9+m9hxaNq7fy2HoXkOuEh/L+D2kkKXk3NUM0 +cHVQdlvYAY1nSbAgz+ZEqYrwrnguDq/XcKJUCpDaHGEqZ2XNqsCvRlmebegp4s05znN M5fJLXsJJ2zsYKq94yB+k0IJOSutSpKfRe1Oe/vk0rqXgq9cvL4XguCFE06Q3XlbUXYv NPNdHGqVDvYWX9P/WAAQzO4E1oDoGuaLE3TJsaX51Sqahktrj9jp3D9cOVmvWB1vBbDK gpm0T6RarPy8bgZHDFO6oNzYujQYjly6PhX5O/yA6dIWVhhG75bAJsr6/56q8VuLG3Fy UCgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=OEriT2aH; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=YodQ61z4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e185-20020a6369c2000000b0055b82bb0bbdsi7247055pgc.879.2023.07.31.10.10.53; Mon, 31 Jul 2023 10:11:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=OEriT2aH; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=YodQ61z4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233398AbjGaQ3T (ORCPT + 99 others); Mon, 31 Jul 2023 12:29:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232531AbjGaQ3I (ORCPT ); Mon, 31 Jul 2023 12:29:08 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F4E52693; Mon, 31 Jul 2023 09:28:45 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id B3D4822147; Mon, 31 Jul 2023 16:28:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1690820881; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kvhqVbeDEmUV6PN2wba2FNyJnxnf3msKSymDgqRJ+yw=; b=OEriT2aHNyDmTiiYxpMshLL+xG8DlZJUiPE/d4IyTPQ5bys98KwXALgj3XbWjmZEBtqm/F aGrqWGcK0U5MTCP4XT5gruqJoQ8DmXkfOe9YPE91PdYrYdyNDZisY4Vs58UOzIBtVSQfv9 Z6ACpCpdOvT5V7B7Uwp7hL6uxO21EXQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1690820881; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kvhqVbeDEmUV6PN2wba2FNyJnxnf3msKSymDgqRJ+yw=; b=YodQ61z4oGRgZb8dvKs0VH9lLPVxxvkIUm8AOpmnJkpIZRMbPvvg3v/Fy+BMQ8vdLRRJ4M Aue+nM+fOKLYv7Cg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 870E01322C; Mon, 31 Jul 2023 16:28:01 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id T5oAIBHhx2SkEwAAMHmgww (envelope-from ); Mon, 31 Jul 2023 16:28:01 +0000 Message-ID: Date: Mon, 31 Jul 2023 18:28:01 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH v2 1/4] blk-flush: flush_rq should inherit first_rq's cmd_flags Content-Language: en-US To: Christoph Hellwig , chengming.zhou@linux.dev Cc: axboe@kernel.dk, ming.lei@redhat.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, zhouchengming@bytedance.com References: <20230725130102.3030032-1-chengming.zhou@linux.dev> <20230725130102.3030032-2-chengming.zhou@linux.dev> <20230731060957.GA30409@lst.de> From: Hannes Reinecke In-Reply-To: <20230731060957.GA30409@lst.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/31/23 08:09, Christoph Hellwig wrote: > On Tue, Jul 25, 2023 at 09:00:59PM +0800, chengming.zhou@linux.dev wrote: >> From: Chengming Zhou >> >> 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: > Yeah, it does. The flush machinery is sending flushes before and/or after the original request (preflush/postflush). For blocked transports (ie during FC RSCN handling) the transport will error out commands depending on the FAILFAST setting. If FAILFAST is set the SCSI layer gets an STS_TRANSPORT error (causing the I/O to be retried), but STS_ERROR if not set (causing I/O to failed). So if the FAILFAST setting is _not_ aligned between flush_rq and the original we'll get an error on the flush rq and a retry on the original rq, causing the entire command to fail. I guess we need to align them. Cheers, Hannes -- Dr. Hannes Reinecke Kernel Storage Architect hare@suse.de +49 911 74053 688 SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg HRB 36809 (AG Nürnberg), Geschäftsführer: Ivo Totev, Andrew Myers, Andrew McDonald, Martje Boudien Moerman