From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:58948 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751444AbdIMKC7 (ORCPT ); Wed, 13 Sep 2017 06:02:59 -0400 Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v8D9wmdK091084 for ; Wed, 13 Sep 2017 06:02:59 -0400 Received: from e23smtp07.au.ibm.com (e23smtp07.au.ibm.com [202.81.31.140]) by mx0a-001b2d01.pphosted.com with ESMTP id 2cxy9sgwnj-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 13 Sep 2017 06:02:58 -0400 Received: from localhost by e23smtp07.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 13 Sep 2017 20:02:52 +1000 From: Chandan Rajendra To: linux-ext4@vger.kernel.org Cc: "Theodore Ts'o" , Michael Halcrow , linux-fsdevel@vger.kernel.org Subject: Bio: Determining encrypted vs plain content Date: Wed, 13 Sep 2017 15:33:33 +0530 MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Message-Id: <2507710.a1WupZru2S@localhost.localdomain> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Hi, I am trying to get encryption to work on block size < page size scenario (e.g. 4k block size on ppc64's 64k page size). One of the last scenarios that I am working on is to decrypt a page whose blocks are not contiguously stored on the underlying disk. The code assumes that bio's pages are supposed to be decrypted if bio-b_private has a non-zero value (See the definition of ext4_bio_encrypted()). Instead of that, why can't the code extract the first page from the first bio vector of the bio and then use ext4_encrypted_inode(page->mapping->host) to determine if bio's pages are supposed to contain encrypted data? Was there a specific reason to not use ext4_encrypted_inode()? -- chandan