From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:60156 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750705AbeAMFVi (ORCPT ); Sat, 13 Jan 2018 00:21:38 -0500 Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w0D5Jw0G100728 for ; Sat, 13 Jan 2018 00:21:37 -0500 Received: from e06smtp14.uk.ibm.com (e06smtp14.uk.ibm.com [195.75.94.110]) by mx0b-001b2d01.pphosted.com with ESMTP id 2ff9mhbf7g-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Sat, 13 Jan 2018 00:21:37 -0500 Received: from localhost by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sat, 13 Jan 2018 05:21:35 -0000 From: Chandan Rajendra To: Randy Dunlap Cc: linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, tytso@mit.edu Subject: Re: [RFC PATCH 1/8] ext4: use EXT4_INODE_ENCRYPT flag to detect encrypted bio Date: Sat, 13 Jan 2018 10:52:51 +0530 In-Reply-To: <35d7ab9a-4b87-606c-84b0-0fb3ad5e0580@infradead.org> References: <20180112141129.27507-1-chandan@linux.vnet.ibm.com> <20180112141129.27507-2-chandan@linux.vnet.ibm.com> <35d7ab9a-4b87-606c-84b0-0fb3ad5e0580@infradead.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Message-Id: <2637514.5grOLVIibm@localhost.localdomain> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Saturday, January 13, 2018 12:34:04 AM IST Randy Dunlap wrote: > On 01/12/18 06:11, Chandan Rajendra wrote: > > For supporting encryption in blocksize < pagesize scenario, > > bio->bi_private field will be needed to hold the address of the > > encryption context structure. Hence this commit uses > > ext4_encrypted_inode() to detect the encryption status of a file. > > > > Signed-off-by: Chandan Rajendra > > --- > > fs/ext4/readpage.c | 8 +++++++- > > 1 file changed, 7 insertions(+), 1 deletion(-) > > > > diff --git a/fs/ext4/readpage.c b/fs/ext4/readpage.c > > index 9ffa6fa..0be590b 100644 > > --- a/fs/ext4/readpage.c > > +++ b/fs/ext4/readpage.c > > @@ -50,7 +50,13 @@ > > static inline bool ext4_bio_encrypted(struct bio *bio) > > { > > #ifdef CONFIG_EXT4_FS_ENCRYPTION > > - return unlikely(bio->bi_private != NULL); > > + if (bio->bi_vcnt) { > > + struct inode *inode = bio->bi_io_vec->bv_page->mapping->host; > > + if (ext4_encrypted_inode(inode) && S_ISREG(inode->i_mode)) > > + return true; > > There are lots of spaces instead of tabs above... > I will fix them up in the next version of the patchset. Thanks for pointing it out. -- chandan