diff options
author | Joe Perches <joe@perches.com> | 2010-11-23 21:49:54 -0500 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2011-01-10 13:04:05 -0500 |
commit | 055adcbd7da75868697e767adc4f3272f6cae76c (patch) | |
tree | 613866918d108adf8536a0d0aab0f1d3bc2c5072 /fs/quota/dquot.c | |
parent | 9c52749232b5cef506877ac633ea14083bd17e02 (diff) |
quota: Use %pV and __attribute__((format (printf in __quota_error and fix fallout
Use %pV in __quota_error so a single printk can not be
interleaved with other logging messages.
Add __attribute__((format (printf, 3, 4))) so format
and arguments can be verified by compiler.
Make sure printk formats and arguments match.
Block # needed a pointer dereference.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/quota/dquot.c')
-rw-r--r-- | fs/quota/dquot.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c index 0fed41e6efcd..84becd3e4772 100644 --- a/fs/quota/dquot.c +++ b/fs/quota/dquot.c | |||
@@ -133,16 +133,20 @@ __cacheline_aligned_in_smp DEFINE_SPINLOCK(dq_data_lock); | |||
133 | EXPORT_SYMBOL(dq_data_lock); | 133 | EXPORT_SYMBOL(dq_data_lock); |
134 | 134 | ||
135 | void __quota_error(struct super_block *sb, const char *func, | 135 | void __quota_error(struct super_block *sb, const char *func, |
136 | const char *fmt, ...) | 136 | const char *fmt, ...) |
137 | { | 137 | { |
138 | va_list args; | ||
139 | |||
140 | if (printk_ratelimit()) { | 138 | if (printk_ratelimit()) { |
139 | va_list args; | ||
140 | struct va_format vaf; | ||
141 | |||
141 | va_start(args, fmt); | 142 | va_start(args, fmt); |
142 | printk(KERN_ERR "Quota error (device %s): %s: ", | 143 | |
143 | sb->s_id, func); | 144 | vaf.fmt = fmt; |
144 | vprintk(fmt, args); | 145 | vaf.va = &args; |
145 | printk("\n"); | 146 | |
147 | printk(KERN_ERR "Quota error (device %s): %s: %pV\n", | ||
148 | sb->s_id, func, &vaf); | ||
149 | |||
146 | va_end(args); | 150 | va_end(args); |
147 | } | 151 | } |
148 | } | 152 | } |