From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 685F520E9 for ; Thu, 7 Apr 2022 05:18:59 +0000 (UTC) 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 B3E5F210E1; Thu, 7 Apr 2022 05:18:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1649308737; 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=A+yNUODWma7WknR/jI5cBa/CbnRiNAE8PcMaVQDIzR4=; b=mnCB1gF89XJ5ZS0vn/sLXjbjQHE0OVf5/BCbnACnemfg918qFrAMS1uu96deBrWbKaTk0y 986H3NVh/IurAPnL2y9HkNS4LPMQclLG/RGT1PVgOxZNeKUsvsv1qbmzIT0Ddpaw+xC6qE NWA7dPYsE9i1SiYQLl3VkO1mNMjLBac= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1649308737; 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=A+yNUODWma7WknR/jI5cBa/CbnRiNAE8PcMaVQDIzR4=; b=kD2ssGZ1opFQemhwtjj59lbGNVo/3qb1+9BNGH243uIB4Twx+Dpu/NW4coV8ja6JRSUAIx INPQyHL1JAX+fNCg== 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 1F2F413A66; Thu, 7 Apr 2022 05:18:50 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 9Lo/Nzp0TmKaQQAAMHmgww (envelope-from ); Thu, 07 Apr 2022 05:18:50 +0000 Message-ID: Date: Thu, 7 Apr 2022 13:18:49 +0800 Precedence: bulk X-Mailing-List: ntfs3@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH 25/27] block: remove QUEUE_FLAG_DISCARD Content-Language: en-US To: Christoph Hellwig Cc: 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, Jens Axboe , 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 References: <20220406060516.409838-1-hch@lst.de> <20220406060516.409838-26-hch@lst.de> From: Coly Li In-Reply-To: <20220406060516.409838-26-hch@lst.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 4/6/22 2:05 PM, Christoph Hellwig wrote: > Just use a non-zero max_discard_sectors as an indicator for discard > support, similar to what is done for write zeroes. > > The only places where needs special attention is the RAID5 driver, > which must clear discard support for security reasons by default, > even if the default stacking rules would allow for it. > > Signed-off-by: Christoph Hellwig For the bcache part, Acked-by: Coly Li Thanks. Coly Li > --- > arch/um/drivers/ubd_kern.c | 2 -- > block/blk-mq-debugfs.c | 1 - > drivers/block/drbd/drbd_nl.c | 15 --------------- > drivers/block/loop.c | 2 -- > drivers/block/nbd.c | 3 --- > drivers/block/null_blk/main.c | 1 - > drivers/block/rbd.c | 1 - > drivers/block/rnbd/rnbd-clt.c | 2 -- > drivers/block/virtio_blk.c | 2 -- > drivers/block/xen-blkfront.c | 2 -- > drivers/block/zram/zram_drv.c | 1 - > drivers/md/bcache/super.c | 1 - > drivers/md/dm-table.c | 5 +---- > drivers/md/dm-thin.c | 2 -- > drivers/md/dm.c | 1 - > drivers/md/md-linear.c | 9 --------- > drivers/md/raid0.c | 7 ------- > drivers/md/raid1.c | 14 -------------- > drivers/md/raid10.c | 14 -------------- > drivers/md/raid5.c | 12 ++++-------- > drivers/mmc/core/queue.c | 1 - > drivers/mtd/mtd_blkdevs.c | 1 - > drivers/nvme/host/core.c | 6 ++---- > drivers/s390/block/dasd_fba.c | 1 - > drivers/scsi/sd.c | 2 -- > include/linux/blkdev.h | 2 -- > 26 files changed, 7 insertions(+), 103 deletions(-) [snipped] > diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c > index 296f200b2e208..2f49e31142f62 100644 > --- a/drivers/md/bcache/super.c > +++ b/drivers/md/bcache/super.c > @@ -973,7 +973,6 @@ static int bcache_device_init(struct bcache_device *d, unsigned int block_size, > > blk_queue_flag_set(QUEUE_FLAG_NONROT, d->disk->queue); > blk_queue_flag_clear(QUEUE_FLAG_ADD_RANDOM, d->disk->queue); > - blk_queue_flag_set(QUEUE_FLAG_DISCARD, d->disk->queue); > > blk_queue_write_cache(q, true, true); > [snipped] From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 535C2C433EF for ; Thu, 7 Apr 2022 05:19:13 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.94.2) (envelope-from ) id 1ncKY4-0008AW-9x; Thu, 07 Apr 2022 05:19:11 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ncKY3-0008AI-9X; Thu, 07 Apr 2022 05:19:10 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:Content-Type:In-Reply-To: From:References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=A+yNUODWma7WknR/jI5cBa/CbnRiNAE8PcMaVQDIzR4=; b=Py6J77sfEHRt37IWtzzZs+T/vz PFWykpF+8iJBrcL91RgqveqGlYF7XoMwk8zWnK9ORnRAJ1LdZOGO+ZQ8ENKqjhsyQdRY431mg+NNg Cq5zoHZlNnAQyvasWcE9U7M4uqAvdTLFmBzdASbWQlMgGVhhSOM7kdDnGDzO8XtR3bJM=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:References:Cc:To: Subject:MIME-Version:Date:Message-ID:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=A+yNUODWma7WknR/jI5cBa/CbnRiNAE8PcMaVQDIzR4=; b=XmdqjCCVjljIVo4DQjVn+dPhrB 168GsUDMR/QXRuAcHu6xbbaTu099dNLXrHKyhSDGuNVpXdGfbG8pfeC7VYLRRxH12ATHV/tdLSQTW 47K3D/WhJT++JRwyIUsFSjv5BQs6JFCbQ1P4iYcUCcLyMjFBUrKSlwlyMuFHWBjvEjF8=; Received: from smtp-out1.suse.de ([195.135.220.28]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.94.2) id 1ncKXw-0006Gl-Rb; Thu, 07 Apr 2022 05:19:10 +0000 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 B3E5F210E1; Thu, 7 Apr 2022 05:18:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1649308737; 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=A+yNUODWma7WknR/jI5cBa/CbnRiNAE8PcMaVQDIzR4=; b=mnCB1gF89XJ5ZS0vn/sLXjbjQHE0OVf5/BCbnACnemfg918qFrAMS1uu96deBrWbKaTk0y 986H3NVh/IurAPnL2y9HkNS4LPMQclLG/RGT1PVgOxZNeKUsvsv1qbmzIT0Ddpaw+xC6qE NWA7dPYsE9i1SiYQLl3VkO1mNMjLBac= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1649308737; 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=A+yNUODWma7WknR/jI5cBa/CbnRiNAE8PcMaVQDIzR4=; b=kD2ssGZ1opFQemhwtjj59lbGNVo/3qb1+9BNGH243uIB4Twx+Dpu/NW4coV8ja6JRSUAIx INPQyHL1JAX+fNCg== 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 1F2F413A66; Thu, 7 Apr 2022 05:18:50 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 9Lo/Nzp0TmKaQQAAMHmgww (envelope-from ); Thu, 07 Apr 2022 05:18:50 +0000 Message-ID: Date: Thu, 7 Apr 2022 13:18:49 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Content-Language: en-US To: Christoph Hellwig References: <20220406060516.409838-1-hch@lst.de> <20220406060516.409838-26-hch@lst.de> From: Coly Li In-Reply-To: <20220406060516.409838-26-hch@lst.de> X-Headers-End: 1ncKXw-0006Gl-Rb Subject: Re: [f2fs-dev] [PATCH 25/27] block: remove QUEUE_FLAG_DISCARD X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jfs-discussion@lists.sourceforge.net, linux-nvme@lists.infradead.org, virtualization@lists.linux-foundation.org, linux-mm@kvack.org, dm-devel@redhat.com, target-devel@vger.kernel.org, linux-mtd@lists.infradead.org, drbd-dev@lists.linbit.com, linux-s390@vger.kernel.org, linux-nilfs@vger.kernel.org, linux-scsi@vger.kernel.org, cluster-devel@redhat.com, xen-devel@lists.xenproject.org, linux-ext4@vger.kernel.org, linux-um@lists.infradead.org, nbd@other.debian.org, linux-block@vger.kernel.org, linux-bcache@vger.kernel.org, ceph-devel@vger.kernel.org, Jens Axboe , linux-raid@vger.kernel.org, linux-mmc@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-xfs@vger.kernel.org, ocfs2-devel@oss.oracle.com, linux-fsdevel@vger.kernel.org, ntfs3@lists.linux.dev, linux-btrfs@vger.kernel.org Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net On 4/6/22 2:05 PM, Christoph Hellwig wrote: > Just use a non-zero max_discard_sectors as an indicator for discard > support, similar to what is done for write zeroes. > > The only places where needs special attention is the RAID5 driver, > which must clear discard support for security reasons by default, > even if the default stacking rules would allow for it. > > Signed-off-by: Christoph Hellwig For the bcache part, Acked-by: Coly Li Thanks. Coly Li > --- > arch/um/drivers/ubd_kern.c | 2 -- > block/blk-mq-debugfs.c | 1 - > drivers/block/drbd/drbd_nl.c | 15 --------------- > drivers/block/loop.c | 2 -- > drivers/block/nbd.c | 3 --- > drivers/block/null_blk/main.c | 1 - > drivers/block/rbd.c | 1 - > drivers/block/rnbd/rnbd-clt.c | 2 -- > drivers/block/virtio_blk.c | 2 -- > drivers/block/xen-blkfront.c | 2 -- > drivers/block/zram/zram_drv.c | 1 - > drivers/md/bcache/super.c | 1 - > drivers/md/dm-table.c | 5 +---- > drivers/md/dm-thin.c | 2 -- > drivers/md/dm.c | 1 - > drivers/md/md-linear.c | 9 --------- > drivers/md/raid0.c | 7 ------- > drivers/md/raid1.c | 14 -------------- > drivers/md/raid10.c | 14 -------------- > drivers/md/raid5.c | 12 ++++-------- > drivers/mmc/core/queue.c | 1 - > drivers/mtd/mtd_blkdevs.c | 1 - > drivers/nvme/host/core.c | 6 ++---- > drivers/s390/block/dasd_fba.c | 1 - > drivers/scsi/sd.c | 2 -- > include/linux/blkdev.h | 2 -- > 26 files changed, 7 insertions(+), 103 deletions(-) [snipped] > diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c > index 296f200b2e208..2f49e31142f62 100644 > --- a/drivers/md/bcache/super.c > +++ b/drivers/md/bcache/super.c > @@ -973,7 +973,6 @@ static int bcache_device_init(struct bcache_device *d, unsigned int block_size, > > blk_queue_flag_set(QUEUE_FLAG_NONROT, d->disk->queue); > blk_queue_flag_clear(QUEUE_FLAG_ADD_RANDOM, d->disk->queue); > - blk_queue_flag_set(QUEUE_FLAG_DISCARD, d->disk->queue); > > blk_queue_write_cache(q, true, true); > [snipped] _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5370DC43217 for ; Thu, 7 Apr 2022 05:19:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=RdnrZVx6tEezUZhSQi+0t5iZuuELisugL8YAoht4QCQ=; b=LvCQD2u7St/EgW QN5vofOHU6NI7+QvC8WSbBPh2iNx5ZbvQEg1VIg/j6hbwKgjOgYEIK8EGvo0DQISRT5OSRKl6acMY e5K6vlzVhUxCYR4lsS8kNbaRr+iyDVqDqThTldFp0v2q6sj9Tb37j9jp/sGfmexqFektjcsh20Ouz 0/dfMY8PlGV5nt5rpMf7OcBg4ffunHtNsACMu3Dhd8UzLn4Yr6jcGaH81h82oEsWzIjQIEvOfEvXo /GT8Xy1sR3PGfp/6P+bDfdfvKK7inArvCNCJ26G2Ug+mim2lAimH7h5LBNSD1CddN9hYd+MkvTBMv 2ZHGMLwFoIHJE+ml/7aw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ncKXv-009V1Y-1v; Thu, 07 Apr 2022 05:19:03 +0000 Received: from smtp-out1.suse.de ([195.135.220.28]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ncKXr-009UzV-4y; Thu, 07 Apr 2022 05:19:00 +0000 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 B3E5F210E1; Thu, 7 Apr 2022 05:18:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1649308737; 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=A+yNUODWma7WknR/jI5cBa/CbnRiNAE8PcMaVQDIzR4=; b=mnCB1gF89XJ5ZS0vn/sLXjbjQHE0OVf5/BCbnACnemfg918qFrAMS1uu96deBrWbKaTk0y 986H3NVh/IurAPnL2y9HkNS4LPMQclLG/RGT1PVgOxZNeKUsvsv1qbmzIT0Ddpaw+xC6qE NWA7dPYsE9i1SiYQLl3VkO1mNMjLBac= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1649308737; 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=A+yNUODWma7WknR/jI5cBa/CbnRiNAE8PcMaVQDIzR4=; b=kD2ssGZ1opFQemhwtjj59lbGNVo/3qb1+9BNGH243uIB4Twx+Dpu/NW4coV8ja6JRSUAIx INPQyHL1JAX+fNCg== 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 1F2F413A66; Thu, 7 Apr 2022 05:18:50 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 9Lo/Nzp0TmKaQQAAMHmgww (envelope-from ); Thu, 07 Apr 2022 05:18:50 +0000 Message-ID: Date: Thu, 7 Apr 2022 13:18:49 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH 25/27] block: remove QUEUE_FLAG_DISCARD Content-Language: en-US To: Christoph Hellwig Cc: 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, Jens Axboe , 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 References: <20220406060516.409838-1-hch@lst.de> <20220406060516.409838-26-hch@lst.de> From: Coly Li In-Reply-To: <20220406060516.409838-26-hch@lst.de> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220406_221859_434519_8C812BCC X-CRM114-Status: GOOD ( 16.60 ) X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-mtd" Errors-To: linux-mtd-bounces+linux-mtd=archiver.kernel.org@lists.infradead.org On 4/6/22 2:05 PM, Christoph Hellwig wrote: > Just use a non-zero max_discard_sectors as an indicator for discard > support, similar to what is done for write zeroes. > > The only places where needs special attention is the RAID5 driver, > which must clear discard support for security reasons by default, > even if the default stacking rules would allow for it. > > Signed-off-by: Christoph Hellwig For the bcache part, Acked-by: Coly Li Thanks. Coly Li > --- > arch/um/drivers/ubd_kern.c | 2 -- > block/blk-mq-debugfs.c | 1 - > drivers/block/drbd/drbd_nl.c | 15 --------------- > drivers/block/loop.c | 2 -- > drivers/block/nbd.c | 3 --- > drivers/block/null_blk/main.c | 1 - > drivers/block/rbd.c | 1 - > drivers/block/rnbd/rnbd-clt.c | 2 -- > drivers/block/virtio_blk.c | 2 -- > drivers/block/xen-blkfront.c | 2 -- > drivers/block/zram/zram_drv.c | 1 - > drivers/md/bcache/super.c | 1 - > drivers/md/dm-table.c | 5 +---- > drivers/md/dm-thin.c | 2 -- > drivers/md/dm.c | 1 - > drivers/md/md-linear.c | 9 --------- > drivers/md/raid0.c | 7 ------- > drivers/md/raid1.c | 14 -------------- > drivers/md/raid10.c | 14 -------------- > drivers/md/raid5.c | 12 ++++-------- > drivers/mmc/core/queue.c | 1 - > drivers/mtd/mtd_blkdevs.c | 1 - > drivers/nvme/host/core.c | 6 ++---- > drivers/s390/block/dasd_fba.c | 1 - > drivers/scsi/sd.c | 2 -- > include/linux/blkdev.h | 2 -- > 26 files changed, 7 insertions(+), 103 deletions(-) [snipped] > diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c > index 296f200b2e208..2f49e31142f62 100644 > --- a/drivers/md/bcache/super.c > +++ b/drivers/md/bcache/super.c > @@ -973,7 +973,6 @@ static int bcache_device_init(struct bcache_device *d, unsigned int block_size, > > blk_queue_flag_set(QUEUE_FLAG_NONROT, d->disk->queue); > blk_queue_flag_clear(QUEUE_FLAG_ADD_RANDOM, d->disk->queue); > - blk_queue_flag_set(QUEUE_FLAG_DISCARD, d->disk->queue); > > blk_queue_write_cache(q, true, true); > [snipped] ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0B7D4C4332F for ; Thu, 7 Apr 2022 05:19:11 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-475-sSn-Q3nXNUGRVOmyTYesdg-1; Thu, 07 Apr 2022 01:19:07 -0400 X-MC-Unique: sSn-Q3nXNUGRVOmyTYesdg-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4E9391C01734; Thu, 7 Apr 2022 05:19:06 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 66A47111F3C7; Thu, 7 Apr 2022 05:19:05 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 542FB194034B; Thu, 7 Apr 2022 05:19:04 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 5628F194034F for ; Thu, 7 Apr 2022 05:19:03 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 300E740D2975; Thu, 7 Apr 2022 05:19:03 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast03.extmail.prod.ext.rdu2.redhat.com [10.11.55.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2793640D282A for ; Thu, 7 Apr 2022 05:19:03 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0FF95811E78 for ; Thu, 7 Apr 2022 05:19:03 +0000 (UTC) Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-602-GU0go5heONKda6DH4IG_Zg-1; Thu, 07 Apr 2022 01:18:59 -0400 X-MC-Unique: GU0go5heONKda6DH4IG_Zg-1 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 B3E5F210E1; Thu, 7 Apr 2022 05:18:57 +0000 (UTC) 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 1F2F413A66; Thu, 7 Apr 2022 05:18:50 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 9Lo/Nzp0TmKaQQAAMHmgww (envelope-from ); Thu, 07 Apr 2022 05:18:50 +0000 Message-ID: Date: Thu, 7 Apr 2022 13:18:49 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 To: Christoph Hellwig References: <20220406060516.409838-1-hch@lst.de> <20220406060516.409838-26-hch@lst.de> From: Coly Li In-Reply-To: <20220406060516.409838-26-hch@lst.de> X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 Subject: Re: [dm-devel] [PATCH 25/27] block: remove QUEUE_FLAG_DISCARD X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jfs-discussion@lists.sourceforge.net, linux-nvme@lists.infradead.org, virtualization@lists.linux-foundation.org, linux-mm@kvack.org, dm-devel@redhat.com, target-devel@vger.kernel.org, linux-mtd@lists.infradead.org, drbd-dev@lists.linbit.com, linux-s390@vger.kernel.org, linux-nilfs@vger.kernel.org, linux-scsi@vger.kernel.org, cluster-devel@redhat.com, xen-devel@lists.xenproject.org, linux-ext4@vger.kernel.org, linux-um@lists.infradead.org, nbd@other.debian.org, linux-block@vger.kernel.org, linux-bcache@vger.kernel.org, ceph-devel@vger.kernel.org, Jens Axboe , linux-raid@vger.kernel.org, linux-mmc@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-xfs@vger.kernel.org, ocfs2-devel@oss.oracle.com, linux-fsdevel@vger.kernel.org, ntfs3@lists.linux.dev, linux-btrfs@vger.kernel.org Errors-To: dm-devel-bounces@redhat.com Sender: "dm-devel" X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dm-devel-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" On 4/6/22 2:05 PM, Christoph Hellwig wrote: > Just use a non-zero max_discard_sectors as an indicator for discard > support, similar to what is done for write zeroes. > > The only places where needs special attention is the RAID5 driver, > which must clear discard support for security reasons by default, > even if the default stacking rules would allow for it. > > Signed-off-by: Christoph Hellwig For the bcache part, Acked-by: Coly Li Thanks. Coly Li > --- > arch/um/drivers/ubd_kern.c | 2 -- > block/blk-mq-debugfs.c | 1 - > drivers/block/drbd/drbd_nl.c | 15 --------------- > drivers/block/loop.c | 2 -- > drivers/block/nbd.c | 3 --- > drivers/block/null_blk/main.c | 1 - > drivers/block/rbd.c | 1 - > drivers/block/rnbd/rnbd-clt.c | 2 -- > drivers/block/virtio_blk.c | 2 -- > drivers/block/xen-blkfront.c | 2 -- > drivers/block/zram/zram_drv.c | 1 - > drivers/md/bcache/super.c | 1 - > drivers/md/dm-table.c | 5 +---- > drivers/md/dm-thin.c | 2 -- > drivers/md/dm.c | 1 - > drivers/md/md-linear.c | 9 --------- > drivers/md/raid0.c | 7 ------- > drivers/md/raid1.c | 14 -------------- > drivers/md/raid10.c | 14 -------------- > drivers/md/raid5.c | 12 ++++-------- > drivers/mmc/core/queue.c | 1 - > drivers/mtd/mtd_blkdevs.c | 1 - > drivers/nvme/host/core.c | 6 ++---- > drivers/s390/block/dasd_fba.c | 1 - > drivers/scsi/sd.c | 2 -- > include/linux/blkdev.h | 2 -- > 26 files changed, 7 insertions(+), 103 deletions(-) [snipped] > diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c > index 296f200b2e208..2f49e31142f62 100644 > --- a/drivers/md/bcache/super.c > +++ b/drivers/md/bcache/super.c > @@ -973,7 +973,6 @@ static int bcache_device_init(struct bcache_device *d, unsigned int block_size, > > blk_queue_flag_set(QUEUE_FLAG_NONROT, d->disk->queue); > blk_queue_flag_clear(QUEUE_FLAG_ADD_RANDOM, d->disk->queue); > - blk_queue_flag_set(QUEUE_FLAG_DISCARD, d->disk->queue); > > blk_queue_write_cache(q, true, true); > [snipped] -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel