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 X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F405FC433DB for ; Tue, 9 Mar 2021 07:32:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BE4E16520C for ; Tue, 9 Mar 2021 07:32:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230286AbhCIHbo (ORCPT ); Tue, 9 Mar 2021 02:31:44 -0500 Received: from verein.lst.de ([213.95.11.211]:58639 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230150AbhCIHbO (ORCPT ); Tue, 9 Mar 2021 02:31:14 -0500 Received: by verein.lst.de (Postfix, from userid 2407) id AEA8B68B05; Tue, 9 Mar 2021 08:31:10 +0100 (CET) Date: Tue, 9 Mar 2021 08:31:10 +0100 From: Christoph Hellwig To: Dan Williams Cc: linux-nvdimm@lists.01.org, Christoph Hellwig , Ming Lei , "Martin K. Petersen" , Hannes Reinecke , Jens Axboe , kernel test robot , Vishal Verma , linux-kernel@vger.kernel.org, linux-block@vger.kernel.org Subject: Re: [PATCH] libnvdimm: Let revalidate_disk() revalidate region read-only Message-ID: <20210309073110.GA3140@lst.de> References: <161527286194.446794.5215036039655765042.stgit@dwillia2-desk3.amr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <161527286194.446794.5215036039655765042.stgit@dwillia2-desk3.amr.corp.intel.com> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org On Mon, Mar 08, 2021 at 10:54:22PM -0800, Dan Williams wrote: > Previous kernels allowed the BLKROSET to override the disk's read-only > status. With that situation fixed the pmem driver needs to rely on > revalidate_disk() to clear the disk read-only status after the host > region has been marked read-write. > > Recall that when libnvdimm determines that the persistent memory has > lost persistence (for example lack of energy to flush from DRAM to FLASH > on an NVDIMM-N device) it marks the region read-only, but that state can > be overridden by the user via: > > echo 0 > /sys/bus/nd/devices/regionX/read_only > > ...to date there is no notification that the region has restored > persistence, so the user override is the only recovery. I've just resent my series to kill of ->revalidate_disk for good, so this obvious makes me a little unhappy. Given that ->revalidate_disk only ends up beeing called from the same path that ->open is called, why can't you just hook this up from the open method? Also any reason the sysfs attribute can't just directly propagate the information to the disk? 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 X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A1E28C433DB for ; Tue, 9 Mar 2021 07:31:17 +0000 (UTC) Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1302D65199 for ; Tue, 9 Mar 2021 07:31:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1302D65199 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-nvdimm-bounces@lists.01.org Received: from ml01.vlan13.01.org (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id B5064100EBB9E; Mon, 8 Mar 2021 23:31:16 -0800 (PST) Received-SPF: None (mailfrom) identity=mailfrom; client-ip=213.95.11.211; helo=verein.lst.de; envelope-from=hch@lst.de; receiver= Received: from verein.lst.de (verein.lst.de [213.95.11.211]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 4E3BA100EBB9C for ; Mon, 8 Mar 2021 23:31:13 -0800 (PST) Received: by verein.lst.de (Postfix, from userid 2407) id AEA8B68B05; Tue, 9 Mar 2021 08:31:10 +0100 (CET) Date: Tue, 9 Mar 2021 08:31:10 +0100 From: Christoph Hellwig To: Dan Williams Subject: Re: [PATCH] libnvdimm: Let revalidate_disk() revalidate region read-only Message-ID: <20210309073110.GA3140@lst.de> References: <161527286194.446794.5215036039655765042.stgit@dwillia2-desk3.amr.corp.intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <161527286194.446794.5215036039655765042.stgit@dwillia2-desk3.amr.corp.intel.com> User-Agent: Mutt/1.5.17 (2007-11-01) Message-ID-Hash: LP32TJ5C3JKSFCESVGMFBVBULJNQHAUK X-Message-ID-Hash: LP32TJ5C3JKSFCESVGMFBVBULJNQHAUK X-MailFrom: hch@lst.de X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation CC: linux-nvdimm@lists.01.org, Christoph Hellwig , Ming Lei , Hannes Reinecke , Jens Axboe , kernel test robot , linux-kernel@vger.kernel.org, linux-block@vger.kernel.org X-Mailman-Version: 3.1.1 Precedence: list List-Id: "Linux-nvdimm developer list." Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On Mon, Mar 08, 2021 at 10:54:22PM -0800, Dan Williams wrote: > Previous kernels allowed the BLKROSET to override the disk's read-only > status. With that situation fixed the pmem driver needs to rely on > revalidate_disk() to clear the disk read-only status after the host > region has been marked read-write. > > Recall that when libnvdimm determines that the persistent memory has > lost persistence (for example lack of energy to flush from DRAM to FLASH > on an NVDIMM-N device) it marks the region read-only, but that state can > be overridden by the user via: > > echo 0 > /sys/bus/nd/devices/regionX/read_only > > ...to date there is no notification that the region has restored > persistence, so the user override is the only recovery. I've just resent my series to kill of ->revalidate_disk for good, so this obvious makes me a little unhappy. Given that ->revalidate_disk only ends up beeing called from the same path that ->open is called, why can't you just hook this up from the open method? Also any reason the sysfs attribute can't just directly propagate the information to the disk? _______________________________________________ Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org To unsubscribe send an email to linux-nvdimm-leave@lists.01.org