aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4
diff options
context:
space:
mode:
authorEric Sandeen <sandeen@redhat.com>2010-07-27 11:56:08 -0400
committerTheodore Ts'o <tytso@mit.edu>2010-07-27 11:56:08 -0400
commite3570639c8b5f2c6a5018a2649c2b7c276af76d7 (patch)
tree07c497204ba370c5e64b5868aa704e269e5893a3 /fs/ext4
parentd889dc8382c4d71b6d538b7b13777bc1ec51df10 (diff)
ext4: don't print scary messages for allocation failures post-abort
I often get emails containing the "This should not happen!!" message, conveniently trimmed to remove things like: sd 0:0:0:0: [sda] Unhandled error code sd 0:0:0:0: [sda] Result: hostbyte=DID_OK driverbyte=DRIVER_TIMEOUT sd 0:0:0:0: [sda] CDB: Write(10): 2a 00 03 13 c9 70 00 00 28 00 end_request: I/O error, dev sda, sector 51628400 Aborting journal on device dm-0-8. EXT4-fs error (device dm-0): ext4_journal_start_sb: Detected aborted journal EXT4-fs (dm-0): Remounting filesystem read-only I don't think there is any value to the verbosity if the reason is due to a filesystem abort; it just obfuscates the root cause. Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4')
-rw-r--r--fs/ext4/inode.c25
-rw-r--r--fs/ext4/mballoc.c3
2 files changed, 17 insertions, 11 deletions
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 8279ad73b929..a52d5af99187 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -2228,6 +2228,8 @@ static int mpage_da_map_blocks(struct mpage_da_data *mpd)
2228 2228
2229 blks = ext4_map_blocks(handle, mpd->inode, &map, get_blocks_flags); 2229 blks = ext4_map_blocks(handle, mpd->inode, &map, get_blocks_flags);
2230 if (blks < 0) { 2230 if (blks < 0) {
2231 struct super_block *sb = mpd->inode->i_sb;
2232
2231 err = blks; 2233 err = blks;
2232 /* 2234 /*
2233 * If get block returns with error we simply 2235 * If get block returns with error we simply
@@ -2238,7 +2240,7 @@ static int mpage_da_map_blocks(struct mpage_da_data *mpd)
2238 return 0; 2240 return 0;
2239 2241
2240 if (err == -ENOSPC && 2242 if (err == -ENOSPC &&
2241 ext4_count_free_blocks(mpd->inode->i_sb)) { 2243 ext4_count_free_blocks(sb)) {
2242 mpd->retval = err; 2244 mpd->retval = err;
2243 return 0; 2245 return 0;
2244 } 2246 }
@@ -2250,16 +2252,17 @@ static int mpage_da_map_blocks(struct mpage_da_data *mpd)
2250 * writepage and writepages will again try to write 2252 * writepage and writepages will again try to write
2251 * the same. 2253 * the same.
2252 */ 2254 */
2253 ext4_msg(mpd->inode->i_sb, KERN_CRIT, 2255 if (!(EXT4_SB(sb)->s_mount_flags & EXT4_MF_FS_ABORTED)) {
2254 "delayed block allocation failed for inode %lu at " 2256 ext4_msg(sb, KERN_CRIT,
2255 "logical offset %llu with max blocks %zd with " 2257 "delayed block allocation failed for inode %lu "
2256 "error %d", mpd->inode->i_ino, 2258 "at logical offset %llu with max blocks %zd "
2257 (unsigned long long) next, 2259 "with error %d", mpd->inode->i_ino,
2258 mpd->b_size >> mpd->inode->i_blkbits, err); 2260 (unsigned long long) next,
2259 printk(KERN_CRIT "This should not happen!! " 2261 mpd->b_size >> mpd->inode->i_blkbits, err);
2260 "Data will be lost\n"); 2262 ext4_msg(sb, KERN_CRIT,
2261 if (err == -ENOSPC) { 2263 "This should not happen!! Data will be lost\n");
2262 ext4_print_free_blocks(mpd->inode); 2264 if (err == -ENOSPC)
2265 ext4_print_free_blocks(mpd->inode);
2263 } 2266 }
2264 /* invalidate all the pages */ 2267 /* invalidate all the pages */
2265 ext4_da_block_invalidatepages(mpd, next, 2268 ext4_da_block_invalidatepages(mpd, next,
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index a75de7d44dc9..3da28281bc54 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -3884,6 +3884,9 @@ static void ext4_mb_show_ac(struct ext4_allocation_context *ac)
3884 struct super_block *sb = ac->ac_sb; 3884 struct super_block *sb = ac->ac_sb;
3885 ext4_group_t ngroups, i; 3885 ext4_group_t ngroups, i;
3886 3886
3887 if (EXT4_SB(sb)->s_mount_flags & EXT4_MF_FS_ABORTED)
3888 return;
3889
3887 printk(KERN_ERR "EXT4-fs: Can't allocate:" 3890 printk(KERN_ERR "EXT4-fs: Can't allocate:"
3888 " Allocation context details:\n"); 3891 " Allocation context details:\n");
3889 printk(KERN_ERR "EXT4-fs: status %d flags %d\n", 3892 printk(KERN_ERR "EXT4-fs: status %d flags %d\n",