eCryptfs: Call lower ->flush() from ecryptfs_flush()
commit4dcbf47bac95e0b7cb4e6fa5347318117a19b580
authorTyler Hicks <tyhicks@canonical.com>
Thu, 13 Sep 2012 01:38:00 +0000 (12 18:38 -0700)
committerBen Hutchings <ben@decadent.org.uk>
Wed, 17 Oct 2012 02:49:54 +0000 (17 03:49 +0100)
tree924daeb13e82a1c3379b2c5a0b3246e8caf2a448
parent2f45faef3bca26259cb419692f70788e5b77f563
eCryptfs: Call lower ->flush() from ecryptfs_flush()

commit 64e6651dcc10e9d2cc6230208a8e6c2cfd19ae18 upstream.

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>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
fs/ecryptfs/file.c