Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1128262ybi; Fri, 21 Jun 2019 14:29:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqzNdY0MyCpH1CVThsj+iL9hwH56dTOxd8HZfgXr5uLOv9Kwlyo87XWiva2coSIrU7HVmAkA X-Received: by 2002:a63:fc61:: with SMTP id r33mr20558694pgk.294.1561152599640; Fri, 21 Jun 2019 14:29:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561152599; cv=none; d=google.com; s=arc-20160816; b=bBn+/uCTyCl0yZ2pnJLGEAepdyascwiJn75BONfW5iACn+4fiNeqaLyh5VSTM5Fkc2 KFn88IOHjzmo8Znzdyy0befjrwdCVVq+qO2gJwQkHIUY6Yy4comkg0dgzUX6OjI1GPWs L+l1aGXNYmpYDP7MZHH0BgQ3+r4XnwUVuVCG361qx3my74KKIK7eJBiZObbabyTVVlg1 lSFyuE33OUALjV1Qq74RG6LqU1HaWpT9nzQD1RJz1lxn7kZFRnUIs5wi2gP2Uw9MGfit WDSP5OfJWznckkcXw+0e3v55zhgAtz8WNAdrf7272ORp3atr5iIAVnuRP+SvlCL/7Ion 2piA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=DJAjcRLRyFA7U2tfH5+NjqlztSuvNgOrdOXGKJjBIvk=; b=YOiTCwNFksiJ8AbrHDpQejknGdRh5N/VIhr+etxFdf8t8bqMLkM6Fv+akuRIuTASYe q3SenMpYaQC8VnbK823kOeXIgCE/xgvWUxYiofWEAinmh62xyec8LUYBNzzDlEQN0bB9 kTVuZ5qfAjQvoAAjMClscJpNPNXXGnvlYnMQgvl0BoC8GcMaGMgppUFhj6ZSlcsantxj X2zyK7pr86ESo0cSjuncfiT+ZPWkYk71WBkyvHp09P6Ls9MTrfZWfDe3E6lcnDCbD2S5 WQvCwMRAsWC4nUQFvDs+nAHboWK0HRHmkMrqsmAHhm5uKKO81S33ZE1TeVYaDjFgEmvp pWvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=MabZLVID; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a88si4125786pje.6.2019.06.21.14.29.43; Fri, 21 Jun 2019 14:29:59 -0700 (PDT) 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=pass header.i=@kernel.org header.s=default header.b=MabZLVID; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726052AbfFUV3U (ORCPT + 99 others); Fri, 21 Jun 2019 17:29:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:54180 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726017AbfFUV3U (ORCPT ); Fri, 21 Jun 2019 17:29:20 -0400 Received: from gmail.com (unknown [104.132.1.77]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C5BDB2070B; Fri, 21 Jun 2019 21:29:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561152559; bh=ogVKbMJ5T5lsvd4JY0yqPnzxZx9NMvopyYs1Uuxvbkc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=MabZLVIDvK/dqbb9/82A7677C+We+QwWW131tS9RhruFU5f3KRrvIUrjiD7lk55se SIRqU/RwWMrKxB1nTiX0VjfpkKZ3uruRgCAosYRkPQCUdAvht1BfGleBYnZjAl4zMs A5/rAPyXbWgnF027AlTOnDxl4RZXqCpWBmdJXaVo= Date: Fri, 21 Jun 2019 14:29:17 -0700 From: Eric Biggers To: Chandan Rajendra Cc: linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-fscrypt@vger.kernel.org, tytso@mit.edu, adilger.kernel@dilger.ca, jaegeuk@kernel.org, yuchao0@huawei.com, hch@infradead.org Subject: Re: [PATCH V3 6/7] Add decryption support for sub-pagesized blocks Message-ID: <20190621212916.GD167064@gmail.com> References: <20190616160813.24464-1-chandan@linux.ibm.com> <20190616160813.24464-7-chandan@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190616160813.24464-7-chandan@linux.ibm.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Sun, Jun 16, 2019 at 09:38:12PM +0530, Chandan Rajendra wrote: > To support decryption of sub-pagesized blocks this commit adds code to, > 1. Track buffer head in "struct read_callbacks_ctx". > 2. Pass buffer head argument to all read callbacks. > 3. Add new fscrypt helper to decrypt the file data referred to by a > buffer head. > > Signed-off-by: Chandan Rajendra > --- > fs/buffer.c | 55 +++++++++------ > fs/crypto/bio.c | 21 +++++- > fs/f2fs/data.c | 2 +- > fs/mpage.c | 2 +- > fs/read_callbacks.c | 118 +++++++++++++++++++++++++-------- > include/linux/buffer_head.h | 1 + > include/linux/read_callbacks.h | 13 +++- > 7 files changed, 158 insertions(+), 54 deletions(-) > This is another patch that unnecessarily changes way too many components at once. My suggestions elsewhere would resolve this, though: - This patch changes fs/f2fs/data.c and fs/mpage.c only to pass a NULL buffer_head to read_callbacks_setup(). But as per my comments on patch 1, read_callbacks_setup() should be split into read_callbacks_setup_bio() and read_callbacks_end_bh(). - This patch changes fs/crypto/ only to add support for the buffer_head decryption work. But as per my comments on patch 1, that should be in read_callbacks.c instead. And adding buffer_head support to fs/read_callbacks.c should be its own patch, *or* should simply be folded into the patch that adds fs/read_callbacks.c. Then the only thing remaining in this patch would be updating fs/buffer.c to make it use the read_callbacks, which should be retitled to something like "fs/buffer.c: add decryption support via read_callbacks". - Eric