Skip to content

Commit 9503c67

Browse files
Matthew Wilcoxtytso
authored andcommitted
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 <[email protected]> Signed-off-by: "Theodore Ts'o" <[email protected]> Reviewed-by: Jan Kara <[email protected]> Cc: [email protected]
1 parent 0076493 commit 9503c67

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

fs/ext4/page-io.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,13 +308,14 @@ static void ext4_end_bio(struct bio *bio, int error)
308308
if (error) {
309309
struct inode *inode = io_end->inode;
310310

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 "
312312
"(offset %llu size %ld starting block %llu)",
313-
inode->i_ino,
313+
error, inode->i_ino,
314314
(unsigned long long) io_end->offset,
315315
(long) io_end->size,
316316
(unsigned long long)
317317
bi_sector >> (inode->i_blkbits - 9));
318+
mapping_set_error(inode->i_mapping, error);
318319
}
319320

320321
if (io_end->flag & EXT4_IO_END_UNWRITTEN) {

0 commit comments

Comments
 (0)