diff options
Diffstat (limited to 'fs/ext4')
-rw-r--r-- | fs/ext4/inode.c | 25 | ||||
-rw-r--r-- | fs/ext4/mballoc.c | 3 |
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", |