Whamcloud - gitweb
LU-000 libcfs: allow debug to be set to numeric -1
authorAndreas Dilger <adilger@whamcloud.com>
Fri, 21 Oct 2011 21:45:17 +0000 (15:45 -0600)
committerOleg Drokin <green@whamcloud.com>
Thu, 3 Nov 2011 06:57:47 +0000 (02:57 -0400)
Don't warn if debug is set to "-1", which should always mean
"enable all debugging".

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I1503d2f5776043e9a4ec3bc4af710ae35ca97960
Reviewed-on: http://review.whamcloud.com/1577
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Johann Lombardi <johann@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
libcfs/libcfs/debug.c

index 00fbb56..fb93ac2 100644 (file)
@@ -319,8 +319,8 @@ libcfs_debug_str2mask(int *mask, const char *str, int is_subsys)
 
         if ((t = sscanf(str, "%i%n", &m, &matched)) >= 1 &&
             matched == n) {
 
         if ((t = sscanf(str, "%i%n", &m, &matched)) >= 1 &&
             matched == n) {
-                /* don't print warning for lctl set_param debug=0 */
-                if (m != 0)
+                /* don't print warning for lctl set_param debug=0 or -1 */
+                if (m != 0 && m != -1)
                         CWARN("You are trying to use a numerical value for the "
                               "mask - this will be deprecated in a future "
                               "release.\n");
                         CWARN("You are trying to use a numerical value for the "
                               "mask - this will be deprecated in a future "
                               "release.\n");