Received: by 2002:a05:6a10:87d6:0:0:0:0 with SMTP id g22csp1063315pxr; Mon, 11 Apr 2022 14:13:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzxj3vLBYWAU3rPURWYyK1chJth50icjgnTDHFB54Af0nxd67P7+FT6Lw1Rx2ALT5FCF43P X-Received: by 2002:a17:90a:98b:b0:1ca:7f92:1bf9 with SMTP id 11-20020a17090a098b00b001ca7f921bf9mr1191865pjo.21.1649711600528; Mon, 11 Apr 2022 14:13:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649711600; cv=none; d=google.com; s=arc-20160816; b=ZpHvLoMKg+Jlbix8cHGvhlC8YyxKLqOMX9I1306F0Ee98OHDlCJH6SyTi48WQpvtR8 z0UQeqxJAgz/vjKEwS16fhWciOnP2vX9yP5QYVBvlrnG2LOgULuNxzXyiDS409uYiu6q JcqRv7hIj4+R0rmZGjvrmKnwWEY34J50k9uIUCCo4h6sKCEau71dYKTqzOHhaEsJ9MEn qRRaTTMmn1+e/QOoA+ce+m2/kWVmjx/PJ8Oi/bFSQhSFy/XfrZhJn9/NNVNOvU9msMTV DXaV6igwovJspOz1Jm9zsz/Bv4nAYJQBubQPzduQGXhLxI22LkQhsASVCT+Cib5BUk0w kYIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=DI0ZRwil3ILS6ylQX8YRjna3F0HIaHCXA8EcPjMP57c=; b=u8Pa/Zvru8McrfACzFFnT9AVvzTd/TCHqBSCcdd18mJ7KiqaeKj0fPcvxrVfwk/9ta EzZDZC7VxWOea4R6prQkTNMhJgqiU890UzAgRU3sAHLjmq1VnOMA/zOx2gT/DoCIIEze 6ki2rsdgPXdxjF0iL9/3opcW3eko5gNSgR9r37UbakqNX3TJ701FCMeMN/YaQiaNLdPN gs6kifFwXkUQMqSIdnzzMyh22k3aC4mGSLc2p2B5s/whJE2fxcGCrBBSP4/EX2UyssWW ff9wxeoNYhb25qVtVXhdtm/L+CVPnxISJeoY7EuWwZCWL7JR2ITbsjYiTTPmIOISKzfj z0MQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Z3DJooO+; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e7-20020a656887000000b0039cdd734355si789269pgt.646.2022.04.11.14.12.57; Mon, 11 Apr 2022 14:13:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-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=@kernel.org header.s=k20201202 header.b=Z3DJooO+; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346846AbiDKOEG (ORCPT + 99 others); Mon, 11 Apr 2022 10:04:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40682 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346841AbiDKOEF (ORCPT ); Mon, 11 Apr 2022 10:04:05 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 379D731DEB; Mon, 11 Apr 2022 07:01:49 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id F3CB6B8160D; Mon, 11 Apr 2022 14:01:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 60E77C385A4; Mon, 11 Apr 2022 14:01:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1649685706; bh=aoF5JI4oA+WPgt/y0IgsxtsbxAXaCuGafPntNOloKP4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Z3DJooO+lpgxb0V7M65iVrqmxI0PEssCJPh+vJ1dEw1YBTDUO4k0Ftowa06gEpR83 S1WtT+TAlqYOA3SV5oPOUKBv5r5Czq1jXlmgnBC2vlAsKUSP12Z7m3WPk2IIXa7ddE 7+rat37phwTAQkXhdDcOfyIkaP50hX9uWu9MCv3Yv354dhMqhNyhEKK5VIXvkcNSo/ Yw75O5ZXcRgYxwAIHqrZej/c3adf+HQOwXoAdC34I68eRF5zbda1Ysdnlbmc/q5KXa +yAvml8INLRMKi4FRTZn17313igwH9BKq1x7zfZpQGp7kDf9WzbZnpQOZP3oofxBEN wCj97MUpv05qA== Date: Mon, 11 Apr 2022 08:01:41 -0600 From: Keith Busch To: Christoph Hellwig Cc: Jens Axboe , dm-devel@redhat.com, linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-um@lists.infradead.org, linux-block@vger.kernel.org, drbd-dev@lists.linbit.com, nbd@other.debian.org, ceph-devel@vger.kernel.org, virtualization@lists.linux-foundation.org, xen-devel@lists.xenproject.org, linux-bcache@vger.kernel.org, linux-raid@vger.kernel.org, linux-mmc@vger.kernel.org, linux-mtd@lists.infradead.org, linux-nvme@lists.infradead.org, linux-s390@vger.kernel.org, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, cluster-devel@redhat.com, jfs-discussion@lists.sourceforge.net, linux-nilfs@vger.kernel.org, ntfs3@lists.linux.dev, ocfs2-devel@oss.oracle.com, linux-mm@kvack.org, "Martin K . Petersen" , Christoph =?iso-8859-1?Q?B=F6hmwalder?= , Coly Li Subject: Re: [PATCH 24/27] block: remove QUEUE_FLAG_DISCARD Message-ID: References: <20220409045043.23593-1-hch@lst.de> <20220409045043.23593-25-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220409045043.23593-25-hch@lst.de> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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-ext4@vger.kernel.org On Sat, Apr 09, 2022 at 06:50:40AM +0200, Christoph Hellwig wrote: > diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c > index efb85c6d8e2d5..7e07dd69262a7 100644 > --- a/drivers/nvme/host/core.c > +++ b/drivers/nvme/host/core.c > @@ -1607,10 +1607,8 @@ static void nvme_config_discard(struct gendisk *disk, struct nvme_ns *ns) > struct request_queue *queue = disk->queue; > u32 size = queue_logical_block_size(queue); > > - if (ctrl->max_discard_sectors == 0) { > - blk_queue_flag_clear(QUEUE_FLAG_DISCARD, queue); > + if (ctrl->max_discard_sectors == 0) > return; > - } I think we need to update the queue limit in this condition. While unlikley, the flag was cleared here in case the device changed support for discard from the previous reset.