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 F05B9C4363C for ; Wed, 7 Oct 2020 07:37:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 97D6820870 for ; Wed, 7 Oct 2020 07:37:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727727AbgJGHhm (ORCPT ); Wed, 7 Oct 2020 03:37:42 -0400 Received: from verein.lst.de ([213.95.11.211]:36452 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726041AbgJGHhm (ORCPT ); Wed, 7 Oct 2020 03:37:42 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 4B76C6736F; Wed, 7 Oct 2020 09:37:39 +0200 (CEST) Date: Wed, 7 Oct 2020 09:37:39 +0200 From: Christoph Hellwig To: Kees Cook Cc: Christoph Hellwig , WeiXiong Liao , linux-kernel@vger.kernel.org Subject: Re: use case for register_pstore_blk? Message-ID: <20201007073739.GA11745@lst.de> References: <20201006155220.GA11668@lst.de> <202010070007.8FF59EC42@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202010070007.8FF59EC42@keescook> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 07, 2020 at 12:13:27AM -0700, Kees Cook wrote: > On Tue, Oct 06, 2020 at 05:52:20PM +0200, Christoph Hellwig wrote: > > Hi WeiXiong, hi Kees, > > > > what is the use case for the code added in commit 17639f67c1d6 > > ("pstore/blk: Introduce backend for block devices"). > > > > This still doesn't have a user, and the API looks really odd to me. > > pstore is a beast. :) The API is there so that a blk device can declare > its direct support of pstore (specifically, to provide a panic_write > handler). > > The MTD device does this, but yes, that's a good point, there isn't a > blk device user of that entry point yet. > > > By our normal kernel rules we should not add new exports without > > users and this should probably be reverted for the 5.9 release. > > I don't want to revert the entire patch (I'm still using > __register_pstore_blk by way of pstore/blk's "best_effort" option), but > I wouldn't object to something like this: That is a minimum. But the MTD support is also completely and utterly broken as well, by declaring on-stack struct file and struct file_operations instances instead of actually reusing the block layer code. This kind of stuff really needs more coordination with the block layer and maintainers instead of the crap that ended up being merged.