aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext3/super.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-01-11 17:36:55 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2011-01-11 17:36:55 -0500
commit40c73abbb37e399eba274fe49e520ffa3dd65bdb (patch)
tree11ee28f09a2455c7134964f7f09e16a93d058c13 /fs/ext3/super.c
parent0945f352ce1520765296fc2b07e50055c847d39d (diff)
parentd96336b05d718b03ff03c94c0dc0cc283a29d534 (diff)
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs-2.6
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs-2.6: ext2: Resolve 'dereferencing pointer to incomplete type' when enabling EXT2_XATTR_DEBUG ext3: Remove redundant unlikely() ext2: Remove redundant unlikely() ext3: speed up file creates by optimizing rec_len functions ext2: speed up file creates by optimizing rec_len functions ext3: Add more journal error check ext3: Add journal error check in resize.c quota: Use %pV and __attribute__((format (printf in __quota_error and fix fallout ext3: Add FITRIM handling ext3: Add batched discard support for ext3 ext3: Add journal error check into ext3_rename() ext3: Use search_dirblock() in ext3_dx_find_entry() ext3: Avoid uninitialized memory references with a corrupted htree directory ext3: Return error code from generic_check_addressable ext3: Add journal error check into ext3_delete_entry() ext3: Add error check in ext3_mkdir() fs/ext3/super.c: Use printf extension %pV fs/ext2/super.c: Use printf extension %pV ext3: don't update sb journal_devnum when RO dev
Diffstat (limited to 'fs/ext3/super.c')
-rw-r--r--fs/ext3/super.c64
1 files changed, 42 insertions, 22 deletions
diff --git a/fs/ext3/super.c b/fs/ext3/super.c
index 77ce1616f72..b7d0554631e 100644
--- a/fs/ext3/super.c
+++ b/fs/ext3/super.c
@@ -143,12 +143,16 @@ void ext3_journal_abort_handle(const char *caller, const char *err_fn,
143void ext3_msg(struct super_block *sb, const char *prefix, 143void ext3_msg(struct super_block *sb, const char *prefix,
144 const char *fmt, ...) 144 const char *fmt, ...)
145{ 145{
146 struct va_format vaf;
146 va_list args; 147 va_list args;
147 148
148 va_start(args, fmt); 149 va_start(args, fmt);
149 printk("%sEXT3-fs (%s): ", prefix, sb->s_id); 150
150 vprintk(fmt, args); 151 vaf.fmt = fmt;
151 printk("\n"); 152 vaf.va = &args;
153
154 printk("%sEXT3-fs (%s): %pV\n", prefix, sb->s_id, &vaf);
155
152 va_end(args); 156 va_end(args);
153} 157}
154 158
@@ -195,15 +199,20 @@ static void ext3_handle_error(struct super_block *sb)
195 sb->s_id); 199 sb->s_id);
196} 200}
197 201
198void ext3_error (struct super_block * sb, const char * function, 202void ext3_error(struct super_block *sb, const char *function,
199 const char * fmt, ...) 203 const char *fmt, ...)
200{ 204{
205 struct va_format vaf;
201 va_list args; 206 va_list args;
202 207
203 va_start(args, fmt); 208 va_start(args, fmt);
204 printk(KERN_CRIT "EXT3-fs error (device %s): %s: ",sb->s_id, function); 209
205 vprintk(fmt, args); 210 vaf.fmt = fmt;
206 printk("\n"); 211 vaf.va = &args;
212
213 printk(KERN_CRIT "EXT3-fs error (device %s): %s: %pV\n",
214 sb->s_id, function, &vaf);
215
207 va_end(args); 216 va_end(args);
208 217
209 ext3_handle_error(sb); 218 ext3_handle_error(sb);
@@ -274,15 +283,20 @@ void __ext3_std_error (struct super_block * sb, const char * function,
274 * case we take the easy way out and panic immediately. 283 * case we take the easy way out and panic immediately.
275 */ 284 */
276 285
277void ext3_abort (struct super_block * sb, const char * function, 286void ext3_abort(struct super_block *sb, const char *function,
278 const char * fmt, ...) 287 const char *fmt, ...)
279{ 288{
289 struct va_format vaf;
280 va_list args; 290 va_list args;
281 291
282 va_start(args, fmt); 292 va_start(args, fmt);
283 printk(KERN_CRIT "EXT3-fs (%s): error: %s: ", sb->s_id, function); 293
284 vprintk(fmt, args); 294 vaf.fmt = fmt;
285 printk("\n"); 295 vaf.va = &args;
296
297 printk(KERN_CRIT "EXT3-fs (%s): error: %s: %pV\n",
298 sb->s_id, function, &vaf);
299
286 va_end(args); 300 va_end(args);
287 301
288 if (test_opt(sb, ERRORS_PANIC)) 302 if (test_opt(sb, ERRORS_PANIC))
@@ -300,16 +314,20 @@ void ext3_abort (struct super_block * sb, const char * function,
300 journal_abort(EXT3_SB(sb)->s_journal, -EIO); 314 journal_abort(EXT3_SB(sb)->s_journal, -EIO);
301} 315}
302 316
303void ext3_warning (struct super_block * sb, const char * function, 317void ext3_warning(struct super_block *sb, const char *function,
304 const char * fmt, ...) 318 const char *fmt, ...)
305{ 319{
320 struct va_format vaf;
306 va_list args; 321 va_list args;
307 322
308 va_start(args, fmt); 323 va_start(args, fmt);
309 printk(KERN_WARNING "EXT3-fs (%s): warning: %s: ", 324
310 sb->s_id, function); 325 vaf.fmt = fmt;
311 vprintk(fmt, args); 326 vaf.va = &args;
312 printk("\n"); 327
328 printk(KERN_WARNING "EXT3-fs (%s): warning: %s: %pV\n",
329 sb->s_id, function, &vaf);
330
313 va_end(args); 331 va_end(args);
314} 332}
315 333
@@ -1848,13 +1866,15 @@ static int ext3_fill_super (struct super_block *sb, void *data, int silent)
1848 goto failed_mount; 1866 goto failed_mount;
1849 } 1867 }
1850 1868
1851 if (generic_check_addressable(sb->s_blocksize_bits, 1869 err = generic_check_addressable(sb->s_blocksize_bits,
1852 le32_to_cpu(es->s_blocks_count))) { 1870 le32_to_cpu(es->s_blocks_count));
1871 if (err) {
1853 ext3_msg(sb, KERN_ERR, 1872 ext3_msg(sb, KERN_ERR,
1854 "error: filesystem is too large to mount safely"); 1873 "error: filesystem is too large to mount safely");
1855 if (sizeof(sector_t) < 8) 1874 if (sizeof(sector_t) < 8)
1856 ext3_msg(sb, KERN_ERR, 1875 ext3_msg(sb, KERN_ERR,
1857 "error: CONFIG_LBDAF not enabled"); 1876 "error: CONFIG_LBDAF not enabled");
1877 ret = err;
1858 goto failed_mount; 1878 goto failed_mount;
1859 } 1879 }
1860 1880
@@ -2297,7 +2317,7 @@ static int ext3_load_journal(struct super_block *sb,
2297 EXT3_SB(sb)->s_journal = journal; 2317 EXT3_SB(sb)->s_journal = journal;
2298 ext3_clear_journal_err(sb, es); 2318 ext3_clear_journal_err(sb, es);
2299 2319
2300 if (journal_devnum && 2320 if (!really_read_only && journal_devnum &&
2301 journal_devnum != le32_to_cpu(es->s_journal_dev)) { 2321 journal_devnum != le32_to_cpu(es->s_journal_dev)) {
2302 es->s_journal_dev = cpu_to_le32(journal_devnum); 2322 es->s_journal_dev = cpu_to_le32(journal_devnum);
2303 2323