diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index 7de11dcd534d6fdb171c382bf14e896ca0e6b5c3..434c9c34aeb6e12df15942f1272587f7ad087cc8 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h @@ -54,7 +54,8 @@ static inline void mapping_set_error(struct address_space *mapping, int error) __filemap_set_wb_err(mapping, error); /* Record it in superblock */ - errseq_set(&mapping->host->i_sb->s_wb_err, error); + if (mapping->host) + errseq_set(&mapping->host->i_sb->s_wb_err, error); /* Record it in flags for now, for legacy callers */ if (error == -ENOSPC)