Skip to content

Commit

Permalink
UBIFS: make debugging messages light again
Browse files Browse the repository at this point in the history
commit 1f5d78d upstream.

We switch to dynamic debugging in commit
56e4674 but did not take into account that
now we do not control anymore whether a specific message is enabled or not.
So now we lock the "dbg_lock" and release it in every debugging macro, which
make them not so light-weight.

This commit removes the "dbg_lock" protection from the debugging macros to
fix the issue.

The downside is that now our DBGKEY() stuff is broken, but this is not
critical at all and will be fixed later.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Artem Bityutskiy authored and Greg Kroah-Hartman committed Jan 26, 2012
1 parent e4ae34b commit 20ef631
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions fs/ubifs/debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,17 +121,15 @@ const char *dbg_key_str1(const struct ubifs_info *c,
const union ubifs_key *key);

/*
* DBGKEY macros require @dbg_lock to be held, which it is in the dbg message
* macros.
* TODO: these macros are now broken because there is no locking around them
* and we use a global buffer for the key string. This means that in case of
* concurrent execution we will end up with incorrect and messy key strings.
*/
#define DBGKEY(key) dbg_key_str0(c, (key))
#define DBGKEY1(key) dbg_key_str1(c, (key))

#define ubifs_dbg_msg(type, fmt, ...) do { \
spin_lock(&dbg_lock); \
pr_debug("UBIFS DBG " type ": " fmt "\n", ##__VA_ARGS__); \
spin_unlock(&dbg_lock); \
} while (0)
#define ubifs_dbg_msg(type, fmt, ...) \
pr_debug("UBIFS DBG " type ": " fmt "\n", ##__VA_ARGS__)

/* Just a debugging messages not related to any specific UBIFS subsystem */
#define dbg_msg(fmt, ...) \
Expand Down

0 comments on commit 20ef631

Please sign in to comment.