[01/11] log: fix plugin level restore with patterns

Message ID 1566214919-32250-2-git-send-email-david.marchand@redhat.com
State Superseded
Delegated to: Thomas Monjalon
Headers show
Series
  • Fixing log levels for dynamically loaded drivers
Related show

Checks

Context Check Description
ci/mellanox-Performance-Testing success Performance Testing PASS
ci/intel-Performance-Testing success Performance Testing PASS
ci/Intel-compilation fail Compilation issues
ci/iol-Compile-Testing success Compile Testing PASS
ci/checkpatch success coding style OK

Commit Message

David Marchand Aug. 19, 2019, 11:41 a.m.
Same fix as the commit 6ff0f81d0ef7 ("log: fix pattern matching"),
fnmatch returns 0 on success.

Fixes: 7f0bb634a140 ("log: add ability to match log type with globbing")
Fixes: 6ff0f81d0ef7 ("log: fix pattern matching")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 lib/librte_eal/common/eal_common_log.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Andrew Rybchenko Aug. 19, 2019, 12:30 p.m. | #1
On 8/19/19 2:41 PM, David Marchand wrote:
> Same fix as the commit 6ff0f81d0ef7 ("log: fix pattern matching"),
> fnmatch returns 0 on success.
>
> Fixes: 7f0bb634a140 ("log: add ability to match log type with globbing")
> Fixes: 6ff0f81d0ef7 ("log: fix pattern matching")
> Cc: stable@dpdk.org
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>

Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>

Patch

diff --git a/lib/librte_eal/common/eal_common_log.c b/lib/librte_eal/common/eal_common_log.c
index 4f6f227..d9e5808 100644
--- a/lib/librte_eal/common/eal_common_log.c
+++ b/lib/librte_eal/common/eal_common_log.c
@@ -284,7 +284,7 @@  rte_log_register_type_and_pick_level(const char *name, uint32_t level_def)
 			continue;
 
 		if (opt_ll->pattern) {
-			if (fnmatch(opt_ll->pattern, name, 0))
+			if (fnmatch(opt_ll->pattern, name, 0) == 0)
 				level = opt_ll->level;
 		} else {
 			if (regexec(&opt_ll->re_match, name, 0, NULL, 0) == 0)