Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp2135638ybv; Fri, 21 Feb 2020 09:32:13 -0800 (PST) X-Google-Smtp-Source: APXvYqxCcz5Pykm06pAuu60f8xSJ9F/xgkfYbdEt96E4nbwUfPnzvJPbbPx6J4x2Y1bF/0kq3keD X-Received: by 2002:a9d:7489:: with SMTP id t9mr28756801otk.255.1582306333105; Fri, 21 Feb 2020 09:32:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582306333; cv=none; d=google.com; s=arc-20160816; b=z/VMFDBzL8bN0VfjoYp/PERkDJsRnrn/Yzoqte6EWpm2IDiYzgDpaGQdmwF88xb1Ky LAxKcURQ0ZxnxOLIOr3mHlkDvdkX9o+Kqt73dpZr3dMx5nO+rfgE6VQYgEpMxAFJA1Nx ct4aELkTaTDIjo7BRJN/93y6+zZFYuLkY8AfngNAVauPNzDaU0PzoOJbQVsxp6560q++ gBCAfCPdoZFzhjYHS3+JAGwqZIR1qx57n1qjVBulRpun2vX84T1fVxKM6zAJ6wgig5Vc hcyulrNITTH2g9M4fxBBmfKNTRkSWU6NYBI8k7auXs3jkpRoXjYCFYyIj1+LH0I64cKX +DpA== 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 :dkim-signature; bh=pDx3LdN9kmcpyyosCuGFps+kdXETL/vBLPKf49LLrtA=; b=fRRrwTMpXqVz5xBp8bF/9W//Yi8z8N4Dtdu3yxHLlhxe+Er6XQ8Oy6PMmiBA3r9xoo Fx8lysmNI4I9n8wk37tLp+cUAO5CQFXFUI2gFyOTfiCY2MnoayPWFqjxSXQ9dlGZkzas hiSpO4SkJLSbz8C5YEnAfK9lRjY1/AJv59g3mRcqmR+0l9EY8is63Z+fiH6c6px7NHzM yfVu7TaaVZosrS80v7uIHyWBRqbgbPDKCKajuEhzKUd6g2WpCrQGGJA8ngSJBiwW9hhW bM2zkXH7qFViPdNnu57sYehuE4aA8W4evAFAbBm6p5kGJ91Q/pRDtf+1hAlu3JH2DDmS lGrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="WC40/Nnw"; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-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 i3si1803427otc.272.2020.02.21.09.31.59; Fri, 21 Feb 2020 09:32:13 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="WC40/Nnw"; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728957AbgBURbU (ORCPT + 99 others); Fri, 21 Feb 2020 12:31:20 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:53310 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726672AbgBURbT (ORCPT ); Fri, 21 Feb 2020 12:31:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=pDx3LdN9kmcpyyosCuGFps+kdXETL/vBLPKf49LLrtA=; b=WC40/Nnwv876skL3b390tcpGP9 HgE+oXYuSaMQgz5W07wW6Rr47DqxNlyAwrKb3/uPmOsWKnNnVtYE8Xz8DSZGJ3C99Qd3sG6xfF9Ii XuBMvXiTK1amcjIiiq2kC4rs8ffrhGi/JO8Nwy+/88DvBOdifqDnueyctDpfPXJkr2EnAO3y6bwzj 3Y/4M719cDTpkqdmkX6WdGI/x1/3C/oubQQKuEl2mpHoXbl/1syPu+YXJIUiGA/PikgQ4hmyESHN5 9PXCOS8FkY3cPGe3AZJ4n/D8zsxqyOfQG7Y2RkV342MYTYvMNg5nastL2NES3sKMkOr41xuj8BRQJ POSqE2XA==; Received: from hch by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1j5C90-0001Qd-83; Fri, 21 Feb 2020 17:31:18 +0000 Date: Fri, 21 Feb 2020 09:31:18 -0800 From: Christoph Hellwig To: Satya Tangirala Cc: linux-block@vger.kernel.org, linux-scsi@vger.kernel.org, linux-fscrypt@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-ext4@vger.kernel.org, Barani Muthukumaran , Kuohong Wang , Kim Boojin Subject: Re: [PATCH v7 1/9] block: Keyslot Manager for Inline Encryption Message-ID: <20200221173118.GA30670@infradead.org> References: <20200221115050.238976-1-satyat@google.com> <20200221115050.238976-2-satyat@google.com> <20200221170434.GA438@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200221170434.GA438@infradead.org> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Fri, Feb 21, 2020 at 09:04:34AM -0800, Christoph Hellwig wrote: > Given that blk_ksm_get_slot_for_key returns a signed keyslot that > can return errors, and the only callers stores it in a signed variable > I think this function should take a signed slot as well, and the check > for a non-negative slot should be moved here from the only caller. Actually looking over the code again I think it might be better to return only the error code (and that might actually be a blk_status_t), and then use an argument to return a pointer to the actual struct keyslot. That gives us much easier to understand code and better type safety.