From c311b33457e09177199ad5859d4fbc3a3b2d4913 Mon Sep 17 00:00:00 2001 From: tangruilin Date: Mon, 21 Nov 2022 09:54:40 +0800 Subject: [PATCH] test ci Signed-off-by: tangruilin --- curvefs/src/client/s3/client_s3_cache_manager.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/curvefs/src/client/s3/client_s3_cache_manager.cpp b/curvefs/src/client/s3/client_s3_cache_manager.cpp index 36f1262200..36fbfca069 100644 --- a/curvefs/src/client/s3/client_s3_cache_manager.cpp +++ b/curvefs/src/client/s3/client_s3_cache_manager.cpp @@ -2202,8 +2202,6 @@ CURVEFS_ERROR DataCache::Flush(uint64_t inodeId, bool toS3) { RCache, WRCache, } cachePoily = cachePoily::NCache; - bool mayCache = !s3ClientAdaptor_->GetDiskCacheManager() - ->IsDiskCacheFull() && !toS3; VLOG(9) << "DataCache::Flush : now:" << now << ",createTime:" << createTime_ << ",flushIntervalSec:" << flushIntervalSec @@ -2233,9 +2231,13 @@ CURVEFS_ERROR DataCache::Flush(uint64_t inodeId, bool toS3) { << ",Len:" << tmpLen << ",blockPos:" << blockPos << ",blockIndex:" << blockIndex; - if (s3ClientAdaptor_->IsReadCache() && mayCache) { + if (s3ClientAdaptor_->IsReadCache() && + !s3ClientAdaptor_->GetDiskCacheManager() + ->IsDiskCacheFull() && !toS3) { cachePoily = cachePoily::RCache; - } else if (s3ClientAdaptor_->IsReadWriteCache() && mayCache) { + } else if (s3ClientAdaptor_->IsReadWriteCache() && + !s3ClientAdaptor_->GetDiskCacheManager() + ->IsDiskCacheFull() && !toS3) { cachePoily = cachePoily::WRCache; } else { cachePoily = cachePoily::NCache;