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.gnu.org (lists.gnu.org [209.51.188.17]) (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 A8979ECAAD8 for ; Fri, 23 Sep 2022 14:36:42 +0000 (UTC) Received: from localhost ([::1]:36994 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1objnF-0003WW-ND for qemu-devel@archiver.kernel.org; Fri, 23 Sep 2022 10:36:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51458) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1objka-00021Q-6I; Fri, 23 Sep 2022 10:33:56 -0400 Received: from [106.39.185.57] (port=42686 helo=smtp.cecloud.com) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1objkV-0004Pz-BP; Fri, 23 Sep 2022 10:33:55 -0400 Received: from localhost (localhost [127.0.0.1]) by smtp.cecloud.com (Postfix) with ESMTP id 0C6D3FC0203; Fri, 23 Sep 2022 22:33:35 +0800 (CST) X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-ANTISPAM-LEVEL: 2 X-SKE-CHECKED: 1 X-ABS-CHECKED: 1 Received: from [192.168.0.102] (1.39.88.218.broad.cd.sc.dynamic.163data.com.cn [218.88.39.1]) by smtp.cecloud.com (postfix) whith ESMTP id P51407T281469725307248S1663943614105692_; Fri, 23 Sep 2022 22:33:34 +0800 (CST) X-IP-DOMAINF: 1 X-UNIQUE-TAG: <8ea6e25ee459f2ecd7bdf21e21fccb73> X-RL-SENDER: luzhipeng@cestc.cn X-SENDER: luzhipeng@cestc.cn X-LOGIN-NAME: luzhipeng@cestc.cn X-FST-TO: kwolf@redhat.com X-RCPT-COUNT: 4 X-SENDER-IP: 218.88.39.1 X-ATTACHMENT-NUM: 0 X-System-Flag: 0 Message-ID: <82ff13ee-1d8f-7907-bb58-3165a2ec624c@cestc.cn> Date: Fri, 23 Sep 2022 22:33:31 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH] block: unmap (discard) blocks only if discard_zeros flag is true To: Kevin Wolf Cc: qemu-devel , qemu-block@nongnu.org, Hanna Reitz References: <20220923100224.537-1-luzhipeng@cestc.cn> From: luzhipeng In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 106.39.185.57 (failed) Received-SPF: pass client-ip=106.39.185.57; envelope-from=luzhipeng@cestc.cn; helo=smtp.cecloud.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, NICE_REPLY_A=-0.001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" 在 2022/9/23 22:28, Kevin Wolf 写道: > Am 23.09.2022 um 12:02 hat luzhipeng geschrieben: >> From: lu zhipeng >> >> we can unmap(discard) blocks for block devices of supporting discard zeros >> or regular file. >> >> Signed-off-by: lu zhipeng > > This more or less restores the state before commit 34fa110e. The commit > message there explains that s->discard_zeroes is unreliable (in > particular, it is false on block devices on recent kernels even though > they may support zeroing by discard just fine). > > We should instead remove s->discard_zeroes because it is currently > unused. I'll send a patch. > > Kevin > > > OK