Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp1796096imj; Sun, 10 Feb 2019 10:27:47 -0800 (PST) X-Google-Smtp-Source: AHgI3IZqngudavgTWYmVmQsOUBQZATiAhe+oUViiZDbieJFKSkr8k5nCBWJ7alONA/PKtHdNQb8s X-Received: by 2002:a17:902:a50a:: with SMTP id s10mr32358885plq.278.1549823267521; Sun, 10 Feb 2019 10:27:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549823267; cv=none; d=google.com; s=arc-20160816; b=saUcH5afI3a1hsB2OUJSaLjsarHVv2f+NfHNvnTIxquLGzy9emneJidG8ACv24DrL7 B61ZobFZk7vHldLTxCdwkrdrX1XF1JsE71156kYqV4ArxFQz0yyv67sYyViZZlwEAPXr ps1UXLZugt1U6/dOeHD4B/I1NBrQhbN2RAQo1q88Tw4irE4ZrZGLZ6LKhoV41XBuDtE4 WQvr2WEVSirp+U/Y5i4M/TnjdC8B9/r/OcqkPDmrI/sAn9nqbY9gzcVy0CjSNcxAiFaH kWcNWUdyRhbjSPQQJGuBA1W0yUguu3nJqKbHDaZ+6OB+YxYCvUFVAh2Do2KefHs0mhAy AcJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:cc:to:from :date; bh=rjV1uPcmMhyzOTL52yXiDaJ+ByTPt+egNDyJL6hyVjU=; b=LkbGICmws/vk9S2n61Xw3vPbbgtQaGat5jMUg3Kh/K67kh10fZZosVYwoxA88vwTT6 LCGAHKyehnPJijI84s3usqrZLsY0awBug3wq5CywzG/ELgdxAXyCSjsdWJhbmP+CNJCu q34iDz8dXKgumzeCbGKZ5OP53Mpd7CYT9UuNAL40lKLkHCzxksGqPQEpSPyOTghtvNxH pIGpfQ2vftwSV4pwn6j35phTFgzxqQDQIZb8nqfQt6U/b6WXmPPRoFoajppu3rkZiHFa 5RMO9bQt0/4HMQ9vwXBoDX25aIQw+1m2sFtdKbqXCg2uTTO/VEd//6brLxbG5srz2Ebq zL2w== 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 c10si7621253pgj.416.2019.02.10.10.27.31; Sun, 10 Feb 2019 10:27:47 -0800 (PST) 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 S1726303AbfBJS1Z (ORCPT + 99 others); Sun, 10 Feb 2019 13:27:25 -0500 Received: from bout01.mta.xmission.com ([166.70.11.15]:46678 "EHLO bout01.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726000AbfBJS1Z (ORCPT ); Sun, 10 Feb 2019 13:27:25 -0500 Received: from mx03.mta.xmission.com ([166.70.13.213]) by bout01.mta.xmission.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.87) (envelope-from ) id 1gstp4-000613-Ag; Sun, 10 Feb 2019 11:27:22 -0700 Received: from plesk14-shared.xmission.com ([166.70.198.161] helo=plesk14.xmission.com) by mx03.mta.xmission.com with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.87) (envelope-from ) id 1gstp3-0001xG-H4; Sun, 10 Feb 2019 11:27:22 -0700 Received: from hacktheplanet (c-68-50-23-202.hsd1.in.comcast.net [68.50.23.202]) by plesk14.xmission.com (Postfix) with ESMTPSA id 79C4D221D90; Sun, 10 Feb 2019 18:27:20 +0000 (UTC) Date: Sun, 10 Feb 2019 13:26:55 -0500 From: Scott Bauer To: "Derrick, Jonathan" Cc: "hch@infradead.org" , "zub@linux.fjfi.cvut.cz" , "linux-kernel@vger.kernel.org" , "linux-block@vger.kernel.org" , "jonas.rabenstein@studium.uni-erlangen.de" , "axboe@kernel.dk" Message-ID: <20190210182655.GA20491@hacktheplanet> References: <1549054223-12220-1-git-send-email-zub@linux.fjfi.cvut.cz> <1549054223-12220-11-git-send-email-zub@linux.fjfi.cvut.cz> <20190204145244.GJ31132@infradead.org> <1549586652.11868.12.camel@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1549586652.11868.12.camel@intel.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-XM-SPF: eid=1gstp3-0001xG-H4;;;mid=<20190210182655.GA20491@hacktheplanet>;;;hst=mx03.mta.xmission.com;;;ip=166.70.198.161;;;frm=sbauer@plzdonthack.me;;;spf=none X-SA-Exim-Connect-IP: 166.70.198.161 X-SA-Exim-Mail-From: sbauer@plzdonthack.me X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on sa07.xmission.com X-Spam-Level: * X-Spam-Status: No, score=1.0 required=8.0 tests=ALL_TRUSTED,BAYES_50, DCC_CHECK_NEGATIVE,T_TM2_M_HEADER_IN_MSG,T_TooManySym_01,XMSubLong, XM_UncommonTLD01 autolearn=disabled version=3.4.2 X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% * [score: 0.5000] * 0.7 XMSubLong Long Subject * 0.0 T_TM2_M_HEADER_IN_MSG BODY: No description available. * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa07 1397; Body=1 Fuz1=1 Fuz2=1] * 0.0 T_TooManySym_01 4+ unique symbols in subject * 0.5 XM_UncommonTLD01 Less-common TLD X-Spam-DCC: XMission; sa07 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: *;"Derrick, Jonathan" X-Spam-Relay-Country: X-Spam-Timing: total 541 ms - load_scoreonly_sql: 0.04 (0.0%), signal_user_changed: 2.8 (0.5%), b_tie_ro: 1.92 (0.4%), parse: 1.21 (0.2%), extract_message_metadata: 4.5 (0.8%), get_uri_detail_list: 1.70 (0.3%), tests_pri_-1000: 3.3 (0.6%), tests_pri_-950: 6 (1.1%), tests_pri_-900: 1.74 (0.3%), tests_pri_-90: 30 (5.5%), check_bayes: 27 (5.1%), b_tokenize: 10 (1.8%), b_tok_get_all: 8 (1.5%), b_comp_prob: 3.3 (0.6%), b_tok_touch_all: 3.4 (0.6%), b_finish: 0.91 (0.2%), tests_pri_0: 475 (87.9%), check_dkim_signature: 0.74 (0.1%), check_dkim_adsp: 10 (1.8%), poll_dns_idle: 2.5 (0.5%), tests_pri_10: 2.4 (0.4%), tests_pri_500: 11 (2.1%), rewrite_mail: 0.00 (0.0%) Subject: Re: [PATCH v4 10/16] block: sed-opal: add ioctl for done-mark of shadow mbr X-Spam-Flag: No X-SA-Exim-Version: 4.2.1 (built Thu, 05 May 2016 13:38:54 -0600) X-SA-Exim-Scanned: Yes (on mx03.mta.xmission.com) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 08, 2019 at 12:44:14AM +0000, Derrick, Jonathan wrote: > On Thu, 2019-02-07 at 23:56 +0100, David Kozub wrote: > > On Mon, 4 Feb 2019, Christoph Hellwig wrote: > > > > static int opal_enable_disable_shadow_mbr(struct opal_dev *dev, > > > > struct opal_mbr_data *opal_mbr) > > > > { > > > > + u8 token = opal_mbr->enable_disable == OPAL_MBR_ENABLE > > > > + ? OPAL_TRUE : OPAL_FALSE; > > > > const struct opal_step mbr_steps[] = { > > > > { opal_discovery0, }, > > > > { start_admin1LSP_opal_session, &opal_mbr->key }, > > > > - { set_mbr_done, &opal_mbr->enable_disable }, > > > > + { set_mbr_done, &token }, > > Am I missing something here? This seems wrong to me. And I think this > > patch actually changes it by introducing: > > > > + u8 token = opal_mbr->enable_disable == OPAL_MBR_ENABLE > > + ? OPAL_TRUE : OPAL_FALSE; > > > > which is essentially a negation (map 0 to 1 and 1 to 0). Agreed the original code did the opposite of what the user wanted, looks like when I authored it I messed up that enum which set everything off. > > With regard to the new IOC_OPAL_MBR_STATUS: I find the usage of > > OPAL_MBR_ENABLE/DISABLE for this confusing: what should passing > > OPAL_MBR_ENABLE do? Should it enable the shadow MBR? Or should it > > enable the MBR-done flag? I think the implementation in this patch > > interprets OPAL_MBR_ENABLE as 'set the "done" flag to true', thus hiding > > the shadow MBR. But this is not obvious looking at the IOCTL name. For the new ioctl I think we should just add a new enum with the correct nomenclature. So OPAL_MBR_DONE, OPAL_MBR_NOT_DONE. > In order to keep the userspace interface consistent, I'll ACK your > change in this patch, unless Scott can fill me in on why this looks > wrong but is actually right. I think it is just wrong. > > We have 7 bytes in the opal_mbr_data struct we could use for DONE/NOT > DONE. I'm not sure how to go about keeping it consistent with old uapi, > although arguably opal_enable_disable_shadow_mbr is already doing the > wrong thing with DONE and ENABLE so it's low impact. Can we keep the old mbr struct the same and just add a new struct with new enums for the new done ioctl? I think this will keep the new ioctl cleaner instead of trying to apply older, some what incorrectly named, enums. Lastly someone will need to backport his > > > > + u8 token = opal_mbr->enable_disable == OPAL_MBR_ENABLE > > > > + ? OPAL_TRUE : OPAL_FALSE; to stable so we can fix up my broken coding in older kernels. I can do that or, if David wants to do that that's fine... just want to coordinate.