]> www.infradead.org Git - users/jedix/linux-maple.git/commit
ext4 crypto: fix memory leak in ext4_bio_write_page()
authorTheodore Ts'o <tytso@mit.edu>
Sat, 3 Oct 2015 03:54:58 +0000 (23:54 -0400)
committerChuck Anderson <chuck.anderson@oracle.com>
Fri, 5 Feb 2016 03:33:20 +0000 (19:33 -0800)
commit87ae3e4bbdd512d1487e630184ab6a4d86d1264a
tree74d0ce7f5fa3de4c3560ad311643f5251a414d0e
parentb553f83d970dc360d7382425c43844cdf4c4f55e
ext4 crypto: fix memory leak in ext4_bio_write_page()

Orabug: 22623868

commit 937d7b84dca58f2565715f2c8e52f14c3d65fb22 upstream.

There are times when ext4_bio_write_page() is called even though we
don't actually need to do any I/O.  This happens when ext4_writepage()
gets called by the jbd2 commit path when an inode needs to force its
pages written out in order to provide data=ordered guarantees --- and
a page is backed by an unwritten (e.g., uninitialized) block on disk,
or if delayed allocation means the page's backing store hasn't been
allocated yet.  In that case, we need to skip the call to
ext4_encrypt_page(), since in addition to wasting CPU, it leads to a
bounce page and an ext4 crypto context getting leaked.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit b8a7a30104317fd37389b2e2b75cc6f3fa7aef2a)
Signed-off-by: Dan Duval <dan.duval@oracle.com>
fs/ext4/page-io.c