Commit 9503c67c93ed0b95ba62d12d1fd09da6245dbdd6

Authored by Matthew Wilcox
Committed by Theodore Ts'o
1 parent 007649375f

ext4: note the error in ext4_end_bio()

ext4_end_bio() currently throws away the error that it receives.  Chances
are this is part of a spate of errors, one of which will end up getting
the error returned to userspace somehow, but we shouldn't take that risk.
Also print out the errno to aid in debug.

Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Jan Kara <jack@suse.cz>
Cc: stable@vger.kernel.org

Showing 1 changed file with 3 additions and 2 deletions Side-by-side Diff

... ... @@ -308,13 +308,14 @@
308 308 if (error) {
309 309 struct inode *inode = io_end->inode;
310 310  
311   - ext4_warning(inode->i_sb, "I/O error writing to inode %lu "
  311 + ext4_warning(inode->i_sb, "I/O error %d writing to inode %lu "
312 312 "(offset %llu size %ld starting block %llu)",
313   - inode->i_ino,
  313 + error, inode->i_ino,
314 314 (unsigned long long) io_end->offset,
315 315 (long) io_end->size,
316 316 (unsigned long long)
317 317 bi_sector >> (inode->i_blkbits - 9));
  318 + mapping_set_error(inode->i_mapping, error);
318 319 }
319 320  
320 321 if (io_end->flag & EXT4_IO_END_UNWRITTEN) {