]>
Commit | Line | Data |
---|---|---|
c7010373 GKH |
1 | From 1f5d78dc4823a85f112aaa2d0f17624f8c2a6c52 Mon Sep 17 00:00:00 2001 |
2 | From: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | |
3 | Date: Wed, 11 Jan 2012 15:13:27 +0200 | |
4 | Subject: UBIFS: make debugging messages light again | |
5 | ||
6 | From: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | |
7 | ||
8 | commit 1f5d78dc4823a85f112aaa2d0f17624f8c2a6c52 upstream. | |
9 | ||
10 | We switch to dynamic debugging in commit | |
11 | 56e46742e846e4de167dde0e1e1071ace1c882a5 but did not take into account that | |
12 | now we do not control anymore whether a specific message is enabled or not. | |
13 | So now we lock the "dbg_lock" and release it in every debugging macro, which | |
14 | make them not so light-weight. | |
15 | ||
16 | This commit removes the "dbg_lock" protection from the debugging macros to | |
17 | fix the issue. | |
18 | ||
19 | The downside is that now our DBGKEY() stuff is broken, but this is not | |
20 | critical at all and will be fixed later. | |
21 | ||
22 | Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | |
23 | Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> | |
24 | ||
25 | ||
26 | --- | |
27 | fs/ubifs/debug.h | 12 +++++------- | |
28 | 1 file changed, 5 insertions(+), 7 deletions(-) | |
29 | ||
30 | --- a/fs/ubifs/debug.h | |
31 | +++ b/fs/ubifs/debug.h | |
32 | @@ -121,17 +121,15 @@ const char *dbg_key_str1(const struct ub | |
33 | const union ubifs_key *key); | |
34 | ||
35 | /* | |
36 | - * DBGKEY macros require @dbg_lock to be held, which it is in the dbg message | |
37 | - * macros. | |
38 | + * TODO: these macros are now broken because there is no locking around them | |
39 | + * and we use a global buffer for the key string. This means that in case of | |
40 | + * concurrent execution we will end up with incorrect and messy key strings. | |
41 | */ | |
42 | #define DBGKEY(key) dbg_key_str0(c, (key)) | |
43 | #define DBGKEY1(key) dbg_key_str1(c, (key)) | |
44 | ||
45 | -#define ubifs_dbg_msg(type, fmt, ...) do { \ | |
46 | - spin_lock(&dbg_lock); \ | |
47 | - pr_debug("UBIFS DBG " type ": " fmt "\n", ##__VA_ARGS__); \ | |
48 | - spin_unlock(&dbg_lock); \ | |
49 | -} while (0) | |
50 | +#define ubifs_dbg_msg(type, fmt, ...) \ | |
51 | + pr_debug("UBIFS DBG " type ": " fmt "\n", ##__VA_ARGS__) | |
52 | ||
53 | /* Just a debugging messages not related to any specific UBIFS subsystem */ | |
54 | #define dbg_msg(fmt, ...) \ |