From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752163AbeCTWfH (ORCPT ); Tue, 20 Mar 2018 18:35:07 -0400 Received: from mga11.intel.com ([192.55.52.93]:57215 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751680AbeCTWfF (ORCPT ); Tue, 20 Mar 2018 18:35:05 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,337,1517904000"; d="scan'208";a="26638768" Date: Tue, 20 Mar 2018 16:09:08 -0600 From: Scott Bauer To: Jonas Rabenstein Cc: Christoph Hellwig , Jonathan Derrick , Jens Axboe , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 08/11] block: sed-opal: ioctl for writing to shadow mbr Message-ID: <20180320220907.zdzf7baag6haaonm@sbauer-Z170X-UD5> References: <9f94be9c32887aacdcba75bd6a3902d0350eb987.1521482296.git.jonas.rabenstein@studium.uni-erlangen.de> <20180319195224.GA3380@lst.de> <20180320093604.qge2sdnc5jrud6kg@studium.uni-erlangen.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180320093604.qge2sdnc5jrud6kg@studium.uni-erlangen.de> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 20, 2018 at 10:36:04AM +0100, Jonas Rabenstein wrote: > On Mon, Mar 19, 2018 at 08:52:24PM +0100, Christoph Hellwig wrote: > > On Mon, Mar 19, 2018 at 07:36:50PM +0100, Jonas Rabenstein wrote: > > > Allow modification of the shadow mbr. If the shadow mbr is not marked as > > > done, this data will be presented read only as the device content. Only > > > after marking the shadow mbr as done and unlocking a locking range the > > > actual content is accessible. > > > > I hate doing this as an ioctls. Can we make this a sysfs binary file > > so that people can use dd or cat to write the shadow mbr? > I already thought about providing a sysfs interface for all that instead > of using ioctls. But as I am pretty new to kernel programming I do not > have all the required insight. Especially, as writing the mbr requires > the sed-opal password I am unsure how a clean sysfs interface to provide > the password together with a simple dd would look like. > Moreover I already have a patch that changes the 'void *data' argument > to setup_opal_dev to a kobject pointer. As far as I know, this is the > first step to get into the sysfs hierarchy. But as I do not have access > to an NVMe drive and have no idea about its implementation, this change > works only for the scsi side. Post what you have as an RFC (review for comment) and I will test for the NVMe side, and or start a port for NVMe. It doesn't have to be perfect since you're sending it out as RFC. It's just a base for us to test/look at to see if we still like the sysfs way.