lkml.org 
[lkml]   [2016]   [Nov]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [PATCH 01/29] fscrypt: Add in-place encryption mode
    From
    Date
    Eric,

    > On 15.11.2016, at 19:14, Eric Biggers <ebiggers@google.com> wrote:
    >
    > Hi,
    >
    > On Sun, Nov 13, 2016 at 10:20:44PM +0100, Richard Weinberger wrote:
    >> From: David Gstir <david@sigma-star.at>
    >>
    >> ext4 and f2fs require a bounce page when encrypting pages. However, not
    >> all filesystems will need that (eg. UBIFS). This is handled via a
    >> flag on fscrypt_operations where a fs implementation can select in-place
    >> encryption over using a bounce page (which is the default).
    >>
    >> Signed-off-by: David Gstir <david@sigma-star.at>
    >> Signed-off-by: Richard Weinberger <richard@nod.at>
    >
    > The comment for fscrypt_encrypt_page() still says the following:
    >
    > * Called on the page write path. The caller must call
    > * fscrypt_restore_control_page() on the returned ciphertext page to
    > * release the bounce buffer and the encryption context.
    >
    > It seems this isn't correct anymore.

    Yes, this is not true in all cases anymore. Will fix that.

    > It also looks like the fscrypt_context
    > never gets released in the case where the page is encrypted in-place.

    You're right. I've already fixed that locally and will include it in the next patch set.

    > Additionally, after this change the name of the flag FS_WRITE_PATH_FL is
    > misleading, since it now really indicates the presence of a bounce buffer rather
    > than the "write path".

    I can see no use case for FS_WRITE_PATH_FL other than to indicate that the bounce buffer has to be free'd. Is there any reason why we should not just remove it and check the presence of a bounce buffer by a simple "if (ctx->w.bounce_page)" ?

    Thanks,
    David


    \
     
     \ /
      Last update: 2016-11-25 13:10    [W:3.956 / U:0.076 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site