UPSTREAM: eCryptfs: Call lower ->flush() from ecryptfs_flush()
authorTyler Hicks <tyhicks@canonical.com>
Thu, 13 Sep 2012 01:38:00 +0000 (18:38 -0700)
committerChromeBot <chrome-bot@google.com>
Thu, 28 Feb 2013 08:59:49 +0000 (00:59 -0800)
commit708dbf0769bdcb530afa08a7f504c6bc72f4a2f2
tree3a42276f61c34ba5caf175e1654cd7c61f5c410c
parente112fa440e16d4e953714a75f504bf4ae9766875
UPSTREAM: eCryptfs: Call lower ->flush() from ecryptfs_flush()

Since eCryptfs only calls fput() on the lower file in
ecryptfs_release(), eCryptfs should call the lower filesystem's
->flush() from ecryptfs_flush().

If the lower filesystem implements ->flush(), then eCryptfs should try
to flush out any dirty pages prior to calling the lower ->flush(). If
the lower filesystem does not implement ->flush(), then eCryptfs has no
need to do anything in ecryptfs_flush() since dirty pages are now
written out to the lower filesystem in ecryptfs_release().

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
BUG=chromium-os:35732
TEST=daisy build, ENOSPC bubbles up to userspace

(cherry picked from upstream commit 64e6651dcc10e9d2cc6230208a8e6c2cfd19ae18)
Signed-off-by: Kees Cook <keescook@chromium.org>
Change-Id: I44d6ba0eb30b6eebbfbedf3a1d7a8d7eaed28c01
Reviewed-on: https://gerrit.chromium.org/gerrit/44157
Tested-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Will Drewry <wad@chromium.org>
Commit-Queue: Kees Cook <keescook@chromium.org>
fs/ecryptfs/file.c