From 9069780f65492599dc8b43a24d9f48f7a69b24c6 Mon Sep 17 00:00:00 2001 From: Jos Collin Date: Thu, 24 Nov 2022 17:29:32 +0530 Subject: [PATCH] cephfs-top: reset filters when no fs Signed-off-by: Jos Collin --- src/tools/cephfs/top/cephfs-top | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/tools/cephfs/top/cephfs-top b/src/tools/cephfs/top/cephfs-top index 0920f12b0de9b..6f2161fd9ea75 100755 --- a/src/tools/cephfs/top/cephfs-top +++ b/src/tools/cephfs/top/cephfs-top @@ -855,6 +855,11 @@ class FSTop(object): if fs not in fs_list: help = f"Error: The selected filesystem '{fs}' is not available now. " \ "[Press 'q' to go back to home (All Filesystem Info) screen]" + # reset the sort/limit settings if fs_list is empty, otherwise continue the + # settings for the other filesystems. + if not fs_list: + current_states["last_field"] = 'chit' + current_states["limit"] = None self.header.erase() # erase previous text self.fsstats.erase() self.create_header(stats_json, help, screen_title, 3) @@ -981,6 +986,9 @@ class FSTop(object): vscrollEnd = 0 if not fs_list: help = "INFO: No filesystem is available [Press 'q' to quit]" + # reset the sort/limit settings + current_states["last_field"] = 'chit' + current_states["limit"] = None self.header.erase() # erase previous text self.fsstats.erase() self.create_header(stats_json, help, screen_title, 2) -- 2.39.5