Received: by 10.213.65.68 with SMTP id h4csp253695imn; Tue, 20 Mar 2018 02:38:01 -0700 (PDT) X-Google-Smtp-Source: AG47ELu7T3MQlUZwDjR3jerV6Z0Bjw0XaHADn3ybbboQETcmIgs7JQYh/Ccv+rhHJ8ixKaXO4F8l X-Received: by 2002:a17:902:850c:: with SMTP id bj12-v6mr16006209plb.110.1521538681770; Tue, 20 Mar 2018 02:38:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521538681; cv=none; d=google.com; s=arc-20160816; b=WWZio8w8G0aI5WVq57HhvOcoYofVMnbBQdD5KR+/tWEWlul9f2+ob8BhA5h9r+uz5i dFBmsdn3UoMzlWOsvo9FzRYTSbjwMtL4OiFRpgCSfNUbd5tYsg1SRNnXh77FADMTYWqE BrIbH2d3/4nr6QzIgR3M/1ywpwxOeIXKvQLvtOela8zokUTVKHYKV1eXi2LztsaDSswl ezdtfb1kNfsuWA9FD2xEwiTQHzsbhSJ+FHKrGJIZDRUC9Jqs0FOZmOAXY7QZp1j3froG ipn/EcOUNiB6Fl2SpWP7SdQjI5bLxTGPu3yk0wJJi7V/1ZShNKw0mTzG1zYvlcIz1kS6 WgJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=WAy9g+NJ/qB8rzhTomoEqsDY4kypBWXaGsKbcuqrSxs=; b=aaSBFmqIQ6qUcee3Cj4DwGIYuaY/uaO6H6qqRle4qNiSE9dc/3+atFvMMio9rs86o3 LM4+uNHQ9FS5yWUYSJbuZ1woobfAfvRAg9fNhokuafFaBfHAGrItSGtlYPYtPTUn6GiU zDIIynvFBQFVaeqo+EOiKy81w6urI0+LISRdNnb43BqG+MOK24Jg5jvBgD2cyswtmC6A R5W8cjQf91hfuXyHAyh6VdSVIjslU2iIodPFBQd8GGlOzqOLyY7MI+qHlkaEMijAaMOB h2XvS6hFhpt1WJAUgRWmBo5eNTVvDp35BFLWx3vabpEhr5ofwe5cX6QAvNhOIblWjY+d MScQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z10si934936pgz.781.2018.03.20.02.37.44; Tue, 20 Mar 2018 02:38:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752349AbeCTJg2 (ORCPT + 99 others); Tue, 20 Mar 2018 05:36:28 -0400 Received: from mx-rz-3.rrze.uni-erlangen.de ([131.188.11.22]:37614 "EHLO mx-rz-3.rrze.uni-erlangen.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751870AbeCTJgZ (ORCPT ); Tue, 20 Mar 2018 05:36:25 -0400 Received: from mx-rz-3.rrze.uni-erlangen.de (mx-rz-3.rrze.uni-erlangen.de [IPv6:2001:638:a000:1025::16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx-rz-3.rrze.uni-erlangen.de (Postfix) with ESMTPS id 40579N2ZYnz20WB; Tue, 20 Mar 2018 10:36:24 +0100 (CET) Authentication-Results: mx-rz-3.rrze.uni-erlangen.de; dkim=none reason="no signature"; dkim-adsp=none (unprotected policy); dkim-atps=neutral X-Virus-Scanned: amavisd-new at boeck4.rrze.uni-erlangen.de (RRZE) X-RRZE-Flag: Not-Spam X-RRZE-Submit-IP: 23.129.64.102 Received: from uni-erlangen.de (xanaduregio.emeraldonion.org [23.129.64.102]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: U2FsdGVkX1+d44fUNOSpfyebahnzBWsFiX8RI9fFX28=) by smtp-auth.uni-erlangen.de (Postfix) with ESMTPSA id 40579D0hGtz1yGZ; Tue, 20 Mar 2018 10:36:14 +0100 (CET) Date: Tue, 20 Mar 2018 10:36:04 +0100 From: Jonas Rabenstein To: Christoph Hellwig Cc: Jonas Rabenstein , Scott Bauer , 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: <20180320093604.qge2sdnc5jrud6kg@studium.uni-erlangen.de> References: <9f94be9c32887aacdcba75bd6a3902d0350eb987.1521482296.git.jonas.rabenstein@studium.uni-erlangen.de> <20180319195224.GA3380@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180319195224.GA3380@lst.de> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. In other words, if someone could hint me in the right direction, I would be glad to (re)implement the ioctl interface for sysfs. Moreover, this would allow to export some additional information like the current state of the device (is it looke, is sed-opal enabled, whats the current state of mbr, etc.). - Jonas