From: Matthew Wilcox Date: Mon, 7 Apr 2014 14:54:20 +0000 (-0400) Subject: ext4: note the error in ext4_end_bio() X-Git-Tag: upstream/snapshot3+hdmi~3034 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6309a184a691c9e520f2336a46481d5ea04480a2;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git ext4: note the error in ext4_end_bio() commit 9503c67c93ed0b95ba62d12d1fd09da6245dbdd6 upstream. 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 Signed-off-by: "Theodore Ts'o" Reviewed-by: Jan Kara Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/ext4/page-io.c b/fs/ext4/page-io.c index ab95508..c18d95b 100644 --- a/fs/ext4/page-io.c +++ b/fs/ext4/page-io.c @@ -308,13 +308,14 @@ static void ext4_end_bio(struct bio *bio, int error) if (error) { struct inode *inode = io_end->inode; - ext4_warning(inode->i_sb, "I/O error writing to inode %lu " + ext4_warning(inode->i_sb, "I/O error %d writing to inode %lu " "(offset %llu size %ld starting block %llu)", - inode->i_ino, + error, inode->i_ino, (unsigned long long) io_end->offset, (long) io_end->size, (unsigned long long) bi_sector >> (inode->i_blkbits - 9)); + mapping_set_error(inode->i_mapping, error); } if (io_end->flag & EXT4_IO_END_UNWRITTEN) {