diff options
author | Theodore Ts'o <tytso@mit.edu> | 2008-11-05 09:22:24 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2008-11-05 09:22:24 -0500 |
commit | 2a21e37e48b94388f2cc8c0392f104f5443d4bb8 (patch) | |
tree | 271e6b7c181213bc9ffbd7793aef275b924cf63c /fs/ext4/inode.c | |
parent | 97df5d155dee478efe33b001f502e9630e1bba92 (diff) |
ext4: tone down ext4_da_writepages warnings
If the filesystem has errors, ext4_da_writepages() will return a *lot*
of errors, including lots and lots of stack dumps. While it's true
that we are dropping user data on the floor, which is unfortunate, the
stack dumps aren't helpful, and they tend to obscure the true original
root cause of the problem. So in the case where the filesystem has
aborted, return an EROFS right away.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/inode.c')
-rw-r--r-- | fs/ext4/inode.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 5120243024fb..ac97348f85b5 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c | |||
@@ -2397,6 +2397,20 @@ static int ext4_da_writepages(struct address_space *mapping, | |||
2397 | */ | 2397 | */ |
2398 | if (!mapping->nrpages || !mapping_tagged(mapping, PAGECACHE_TAG_DIRTY)) | 2398 | if (!mapping->nrpages || !mapping_tagged(mapping, PAGECACHE_TAG_DIRTY)) |
2399 | return 0; | 2399 | return 0; |
2400 | |||
2401 | /* | ||
2402 | * If the filesystem has aborted, it is read-only, so return | ||
2403 | * right away instead of dumping stack traces later on that | ||
2404 | * will obscure the real source of the problem. We test | ||
2405 | * EXT4_MOUNT_ABORT instead of sb->s_flag's MS_RDONLY because | ||
2406 | * the latter could be true if the filesystem is mounted | ||
2407 | * read-only, and in that case, ext4_da_writepages should | ||
2408 | * *never* be called, so if that ever happens, we would want | ||
2409 | * the stack trace. | ||
2410 | */ | ||
2411 | if (unlikely(sbi->s_mount_opt & EXT4_MOUNT_ABORT)) | ||
2412 | return -EROFS; | ||
2413 | |||
2400 | /* | 2414 | /* |
2401 | * Make sure nr_to_write is >= sbi->s_mb_stream_request | 2415 | * Make sure nr_to_write is >= sbi->s_mb_stream_request |
2402 | * This make sure small files blocks are allocated in | 2416 | * This make sure small files blocks are allocated in |
@@ -2441,7 +2455,7 @@ static int ext4_da_writepages(struct address_space *mapping, | |||
2441 | handle = ext4_journal_start(inode, needed_blocks); | 2455 | handle = ext4_journal_start(inode, needed_blocks); |
2442 | if (IS_ERR(handle)) { | 2456 | if (IS_ERR(handle)) { |
2443 | ret = PTR_ERR(handle); | 2457 | ret = PTR_ERR(handle); |
2444 | printk(KERN_EMERG "%s: jbd2_start: " | 2458 | printk(KERN_CRIT "%s: jbd2_start: " |
2445 | "%ld pages, ino %lu; err %d\n", __func__, | 2459 | "%ld pages, ino %lu; err %d\n", __func__, |
2446 | wbc->nr_to_write, inode->i_ino, ret); | 2460 | wbc->nr_to_write, inode->i_ino, ret); |
2447 | dump_stack(); | 2461 | dump_stack(); |