]> git.proxmox.com Git - zfsonlinux.git/blame - zfs-patches/0003-Fix-TypeError-unorderable-types-str-int-in-arc_summa.patch
fix #1509: arc_summary error with L2ARC
[zfsonlinux.git] / zfs-patches / 0003-Fix-TypeError-unorderable-types-str-int-in-arc_summa.patch
CommitLineData
ea927859
FG
1From 8a6ee659664aacc3dad6588596495190a6764b18 Mon Sep 17 00:00:00 2001
2From: Johnny Stenback <github@jstenback.com>
3Date: Tue, 3 Jan 2017 10:29:23 -0800
4Subject: [PATCH 3/3] Fix TypeError: unorderable types: str() > int() in
5 arc_summary.py
6MIME-Version: 1.0
7Content-Type: text/plain; charset=UTF-8
8Content-Transfer-Encoding: 8bit
9
10Running arc_summary.py with a l2arc cache device around produces
11the 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
22This is due to arc["l2_arc_evicts"]['lock_retries'] and
23arc["l2_arc_evicts"]["reading"] both being strings, returned
24from fHits() earlier. Rather than adding them up and checking
25if the result is > 0, this checks if either string is != '0'.
26
27Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
28Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
29Closes #5538
30
31(cherry picked from commit 5eac94bffd3b98c585eecfbf3fbf444362573142)
32Signed-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
37diff --git a/cmd/arc_summary/arc_summary.py b/cmd/arc_summary/arc_summary.py
38index 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--
532.14.1
54