Update patches based on review
[ext4-patch-queue.git] / note-the-error-in-ext4_end_bio
blob283c616b40db50f905db595375a7ac655f954db8
1 ext4: note the error in ext4_end_bio()
3 From: Matthew Wilcox <willy@linux.intel.com>
5 ext4_end_bio() currently throws away the error that it receives.  Chances
6 are this is part of a spate of errors, one of which will end up getting
7 the error returned to userspace somehow, but we shouldn't take that risk.
8 Also print out the errno to aid in debug.
10 Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
11 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
12 Reviewed-by: Jan Kara <jack@suse.cz>
13 Cc: stable@vger.kernel.org
14 ---
15  fs/ext4/page-io.c | 5 +++--
16  1 file changed, 3 insertions(+), 2 deletions(-)
18 diff --git a/fs/ext4/page-io.c b/fs/ext4/page-io.c
19 index ab95508..c18d95b 100644
20 --- a/fs/ext4/page-io.c
21 +++ b/fs/ext4/page-io.c
22 @@ -308,13 +308,14 @@ static void ext4_end_bio(struct bio *bio, int error)
23         if (error) {
24                 struct inode *inode = io_end->inode;
26 -               ext4_warning(inode->i_sb, "I/O error writing to inode %lu "
27 +               ext4_warning(inode->i_sb, "I/O error %d writing to inode %lu "
28                              "(offset %llu size %ld starting block %llu)",
29 -                            inode->i_ino,
30 +                            error, inode->i_ino,
31                              (unsigned long long) io_end->offset,
32                              (long) io_end->size,
33                              (unsigned long long)
34                              bi_sector >> (inode->i_blkbits - 9));
35 +               mapping_set_error(inode->i_mapping, error);
36         }
38         if (io_end->flag & EXT4_IO_END_UNWRITTEN) {
39 -- 
40 1.9.0
43 To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
44 the body of a message to majordomo@vger.kernel.org
45 More majordomo info at  http://vger.kernel.org/majordomo-info.html