From c5ccd9c2d12812b5c8f0b91c89c31a95e800957d Mon Sep 17 00:00:00 2001 From: Sebastian Messmer Date: Thu, 9 Jun 2016 17:32:35 -0700 Subject: [PATCH] Set cache entry to dirty when timestamps are changed. Otherwise, it wouldn't be written back. --- src/cryfs/filesystem/CryOpenFile.cpp | 2 ++ src/cryfs/filesystem/fsblobstore/DirBlob.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/cryfs/filesystem/CryOpenFile.cpp b/src/cryfs/filesystem/CryOpenFile.cpp index 8a03b2a8..336665b4 100644 --- a/src/cryfs/filesystem/CryOpenFile.cpp +++ b/src/cryfs/filesystem/CryOpenFile.cpp @@ -30,6 +30,7 @@ CryOpenFile::~CryOpenFile() { void CryOpenFile::flush() { _device->callFsActionCallbacks(); _fileBlob->flush(); + _parent->flush(); } void CryOpenFile::stat(struct ::stat *result) const { @@ -59,6 +60,7 @@ void CryOpenFile::write(const void *buf, size_t count, off_t offset) { void CryOpenFile::fsync() { _device->callFsActionCallbacks(); _fileBlob->flush(); + _parent->flush(); } void CryOpenFile::fdatasync() { diff --git a/src/cryfs/filesystem/fsblobstore/DirBlob.cpp b/src/cryfs/filesystem/fsblobstore/DirBlob.cpp index 194dd6fb..a029f0d9 100644 --- a/src/cryfs/filesystem/fsblobstore/DirBlob.cpp +++ b/src/cryfs/filesystem/fsblobstore/DirBlob.cpp @@ -161,11 +161,13 @@ void DirBlob::statChildExceptSize(const Key &key, struct ::stat *result) const { void DirBlob::updateAccessTimestampForChild(const Key &key) { std::unique_lock lock(_mutex); _entries.updateAccessTimestampForChild(key); + _changed = true; } void DirBlob::updateModificationTimestampForChild(const Key &key) { std::unique_lock lock(_mutex); _entries.updateModificationTimestampForChild(key); + _changed = true; } void DirBlob::chmodChild(const Key &key, mode_t mode) {