]>
Commit | Line | Data |
---|---|---|
ea927859 FG |
1 | From 8a6ee659664aacc3dad6588596495190a6764b18 Mon Sep 17 00:00:00 2001 |
2 | From: Johnny Stenback <github@jstenback.com> | |
3 | Date: Tue, 3 Jan 2017 10:29:23 -0800 | |
4 | Subject: [PATCH 3/3] Fix TypeError: unorderable types: str() > int() in | |
5 | arc_summary.py | |
6 | MIME-Version: 1.0 | |
7 | Content-Type: text/plain; charset=UTF-8 | |
8 | Content-Transfer-Encoding: 8bit | |
9 | ||
10 | Running arc_summary.py with a l2arc cache device around produces | |
11 | the following error: | |
12 | ||
13 | Traceback (most recent call last): | |
14 | File "/usr/bin/arc_summary.py", line 1148, in <module> | |
15 | main() | |
16 | File "/usr/bin/arc_summary.py", line 1144, in main | |
17 | page(Kstat) | |
18 | File "/usr/bin/arc_summary.py", line 724, in _l2arc_summary | |
19 | arc["l2_arc_evicts"]["reading"] > 0: | |
20 | TypeError: unorderable types: str() > int() | |
21 | ||
22 | This is due to arc["l2_arc_evicts"]['lock_retries'] and | |
23 | arc["l2_arc_evicts"]["reading"] both being strings, returned | |
24 | from fHits() earlier. Rather than adding them up and checking | |
25 | if the result is > 0, this checks if either string is != '0'. | |
26 | ||
27 | Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> | |
28 | Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov> | |
29 | Closes #5538 | |
30 | ||
31 | (cherry picked from commit 5eac94bffd3b98c585eecfbf3fbf444362573142) | |
32 | Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com> | |
33 | --- | |
34 | cmd/arc_summary/arc_summary.py | 4 ++-- | |
35 | 1 file changed, 2 insertions(+), 2 deletions(-) | |
36 | ||
37 | diff --git a/cmd/arc_summary/arc_summary.py b/cmd/arc_summary/arc_summary.py | |
38 | index 65b5c4dbd..d666c652d 100755 | |
39 | --- a/cmd/arc_summary/arc_summary.py | |
40 | +++ b/cmd/arc_summary/arc_summary.py | |
41 | @@ -720,8 +720,8 @@ def _l2arc_summary(Kstat): | |
42 | ) | |
43 | sys.stdout.write("\n") | |
44 | ||
45 | - if arc["l2_arc_evicts"]['lock_retries'] + \ | |
46 | - arc["l2_arc_evicts"]["reading"] > 0: | |
47 | + if arc["l2_arc_evicts"]['lock_retries'] != '0' or \ | |
48 | + arc["l2_arc_evicts"]["reading"] != '0': | |
49 | sys.stdout.write("L2 ARC Evicts:\n") | |
50 | sys.stdout.write("\tLock Retries:\t\t\t\t%s\n" % | |
51 | arc["l2_arc_evicts"]['lock_retries']) | |
52 | -- | |
53 | 2.14.1 | |
54 |