From: Eric Biggers <ebiggers@google.com>
To: Richard Weinberger <richard@nod.at>
Cc: linux-mtd@lists.infradead.org, david@sigma-star.at,
tytso@mit.edu, dedekind1@gmail.com, mhalcrow@google.com,
adrian.hunter@intel.com, linux-kernel@vger.kernel.org,
hch@infradead.org, linux-fsdevel@vger.kernel.org,
jaegeuk@kernel.org, dengler@linutronix.de, sbabic@denx.de,
wd@denx.de
Subject: Re: [PATCH 2/6] fscrypt: Release fscrypt context on in-place encryption
Date: Fri, 2 Dec 2016 00:12:49 -0800 [thread overview]
Message-ID: <20161202081249.GB18690@google.com> (raw)
In-Reply-To: <1480630498-19201-3-git-send-email-richard@nod.at>
On Thu, Dec 01, 2016 at 11:14:54PM +0100, Richard Weinberger wrote:
> From: David Gstir <david@sigma-star.at>
>
> In case of in-place encryption ctx must be released right away.
> Otherwise ctx is never freed.
>
I didn't notice this before, but the fscrypt_ctx isn't actually used at all in
the "own pages" crypto case. So there's really no need to allocate one. How
about we just handle the "own pages" case at the beginning of
fscrypt_encrypt_page():
if (inode->i_sb->s_cop->flags & FS_CFLG_OWN_PAGES) {
err = do_page_crypto(inode, FS_ENCRYPT, lblk_num, page, page,
len, offs, gfp_flags);
if (err)
return ERR_PTR(err);
return page;
}
(and the rest essentially the same as it used to be)
Eric
next prev parent reply other threads:[~2016-12-02 8:13 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-01 22:14 [PATCH 0/6] UBIFS related fscrypt updates Richard Weinberger
2016-12-01 22:14 ` [PATCH 1/6] fscrypt: Use correct index in decrypt path Richard Weinberger
2016-12-01 22:14 ` [PATCH 2/6] fscrypt: Release fscrypt context on in-place encryption Richard Weinberger
2016-12-02 8:12 ` Eric Biggers [this message]
2016-12-01 22:14 ` [PATCH 3/6] fscrypt: Cleanup fscrypt_{decrypt,encrypt}_page() Richard Weinberger
2016-12-02 8:19 ` Eric Biggers
2016-12-02 15:50 ` David Gstir
2016-12-01 22:14 ` [PATCH 4/6] fscrypt: Cleanup page locking requirements for fscrypt_{decrypt, encrypt}_page() Richard Weinberger
2016-12-01 22:14 ` [PATCH 4/6] fscrypt: Cleanup page locking requirements for fscrypt_{decrypt,encrypt}_page() Richard Weinberger
2016-12-01 22:14 ` [PATCH 5/6] fscrypt: Deplay bounce page pool allocation until needed Richard Weinberger
2016-12-01 22:14 ` [PATCH 6/6] fscrypt: Rename FS_WRITE_PATH_FL to FS_CTX_HAS_BOUNCE_BUFFER_FL Richard Weinberger
2016-12-03 21:56 ` [PATCH 0/6] UBIFS related fscrypt updates Theodore Ts'o
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161202081249.GB18690@google.com \
--to=ebiggers@google.com \
--cc=adrian.hunter@intel.com \
--cc=david@sigma-star.at \
--cc=dedekind1@gmail.com \
--cc=dengler@linutronix.de \
--cc=hch@infradead.org \
--cc=jaegeuk@kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=mhalcrow@google.com \
--cc=richard@nod.at \
--cc=sbabic@denx.de \
--cc=tytso@mit.edu \
--cc=wd@denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.