From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756618AbcIVIvP (ORCPT ); Thu, 22 Sep 2016 04:51:15 -0400 Received: from b.ns.miles-group.at ([95.130.255.144]:44724 "EHLO radon.swed.at" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755693AbcIVIvN (ORCPT ); Thu, 22 Sep 2016 04:51:13 -0400 To: "Theodore Ts'o" , Jaegeuk Kim Cc: "linux-kernel@vger.kernel.org" , linux-fsdevel , linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, David Gstir From: Richard Weinberger Subject: fscrypt: in-place decrypt vs. out-of-place encrypt? Message-ID: Date: Thu, 22 Sep 2016 10:49:41 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi! While reading the fscrypt code I noticed that some functions use the bounce pages and some not. fscrypt_decrypt_page() and fscrypt_decrypt_bio_pages() work in-place while fscrypt_encrypt_page() and fscrypt_zeroout_range() use a bounce page. So, both ext4 and f2fs encrypt data using an extra buffer but decrypt mostly in-place without the need of an extra buffer. Why that? I'd assume when decryption can be done in-place also encryption is possible that way. I'm working on fscrypt for UBIFS and would like to avoid an extra buffer since memory is low on embedded systems. Thanks, //richard