From e831870c8dc993fd4fa16aff03f5cefcc49fe160 Mon Sep 17 00:00:00 2001 From: niloay6 Date: Tue, 26 Sep 2023 09:17:08 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=BD=93=E9=85=8D?= =?UTF-8?q?=E7=BD=AE4=E4=B8=AAstore=5Fpath=E6=97=B6=EF=BC=8C=E7=AC=AC?= =?UTF-8?q?=E4=BA=8C=E4=B8=AApath(store=5Fpath1)=E5=AD=98=E5=82=A8?= =?UTF-8?q?=E8=B6=85=E8=BF=87=E9=98=88=E5=80=BC=E6=97=B6=EF=BC=8C=E9=87=8D?= =?UTF-8?q?=E5=A4=8D=E5=9C=A8=E7=AC=AC=E4=B8=80=E4=B8=AApath(store=5Fpath0?= =?UTF-8?q?)=E5=86=99=E5=85=A5=E7=9A=84=E9=97=AE=E9=A2=98=EF=BC=8C?= =?UTF-8?q?=E5=8D=B3=20store=5Fpath0=20->=20store=5Fpath2=20->=20store=5Fp?= =?UTF-8?q?ath3=EF=BC=8C=E8=80=8C=E4=B8=8D=E6=98=AF=E4=B8=80=E7=9B=B4?= =?UTF-8?q?=E6=98=AFstore=5Fpath0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- storage/storage_service.c | 9 +++++++-- tracker/tracker_service.c | 9 +++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/storage/storage_service.c b/storage/storage_service.c index a62fceb..8a5aa3b 100644 --- a/storage/storage_service.c +++ b/storage/storage_service.c @@ -1665,7 +1665,7 @@ void storage_service_destroy() int storage_get_storage_path_index(int *store_path_index) { - int i; + int i, t; *store_path_index = g_store_path_index; if (g_store_path_mode == FDFS_STORE_PATH_LOAD_BALANCE) @@ -1687,7 +1687,12 @@ int storage_get_storage_path_index(int *store_path_index) [*store_path_index].total_mb, g_fdfs_store_paths.paths \ [*store_path_index].free_mb, g_avg_storage_reserved_mb)) { - for (i=0; i= g_fdfs_store_paths.count) + { + t = 0; + } + for (i=t; i \ path_free_mbs[write_path_index], avg_reserved_mb)) { - int i; - for (i=0; istore_path_count; i++) + int i, t; + t = write_path_index + 1; + if (t >= pStoreGroup->store_path_count) + { + t = 0; + } + for (i=t; istore_path_count; i++) { if (tracker_check_reserved_space_path( \ pStorageServer->path_total_mbs[i], \