aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ext4/inode.c')
-rw-r--r--fs/ext4/inode.c16
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();