From: Jos Collin Date: Thu, 24 Nov 2022 11:59:32 +0000 (+0530) Subject: cephfs-top: reset filters when no fs X-Git-Tag: v18.1.0~786^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=9069780f65492599dc8b43a24d9f48f7a69b24c6;p=ceph.git cephfs-top: reset filters when no fs Signed-off-by: Jos Collin --- 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)