]> git.baikalelectronics.ru Git - kernel.git/commit
eCryptfs: Revert to a writethrough cache model
authorTyler Hicks <tyhicks@canonical.com>
Tue, 3 Jul 2012 23:50:57 +0000 (16:50 -0700)
committerTyler Hicks <tyhicks@canonical.com>
Fri, 13 Jul 2012 23:46:06 +0000 (16:46 -0700)
commit0f3b2b45e85a0adc0df86f60aa450c7b4af0b03c
tree561ee1768e62c120766c40c0b8fc8aa30b4f4a95
parent37c214538a1ecb5544f678537c3b6beb968dd0dd
eCryptfs: Revert to a writethrough cache model

A change was made about a year ago to get eCryptfs to better utilize its
page cache during writes. The idea was to do the page encryption
operations during page writeback, rather than doing them when initially
writing into the page cache, to reduce the number of page encryption
operations during sequential writes. This meant that the encrypted page
would only be written to the lower filesystem during page writeback,
which was a change from how eCryptfs had previously wrote to the lower
filesystem in ecryptfs_write_end().

The change caused a few eCryptfs-internal bugs that were shook out.
Unfortunately, more grave side effects have been identified that will
force changes outside of eCryptfs. Because the lower filesystem isn't
consulted until page writeback, eCryptfs has no way to pass lower write
errors (ENOSPC, mainly) back to userspace. Additionaly, it was reported
that quotas could be bypassed because of the way eCryptfs may sometimes
open the lower filesystem using a privileged kthread.

It would be nice to resolve the latest issues, but it is best if the
eCryptfs commits be reverted to the old behavior in the meantime.

This reverts:
152b2159 "eCryptfs: Flush file in vma close"
489725cb "eCryptfs: Flush dirty pages in setattr"
27e3b8bb "ecryptfs: modify write path to encrypt page in writepage"

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Tested-by: Colin King <colin.king@canonical.com>
Cc: Colin King <colin.king@canonical.com>
Cc: Thieu Le <thieule@google.com>
fs/ecryptfs/file.c
fs/ecryptfs/inode.c
fs/ecryptfs/mmap.c