summaryrefslogtreecommitdiff
path: root/drivers/md/raid5.h
diff options
context:
space:
mode:
authorSong Liu <songliubraving@fb.com>2016-11-24 09:50:39 +0300
committerShaohua Li <shli@fb.com>2016-11-28 08:35:38 +0300
commitd7bd398e97f236a2353689eca5e8950f67cd34d5 (patch)
treeed071303317acc6ba7008e808fec5845ab5fe45b /drivers/md/raid5.h
parent034e33f5eda3c61edb838471f69ec42d64e1e94e (diff)
downloadlinux-d7bd398e97f236a2353689eca5e8950f67cd34d5.tar.xz
md/r5cache: handle alloc_page failure
RMW of r5c write back cache uses an extra page to store old data for prexor. handle_stripe_dirtying() allocates this page by calling alloc_page(). However, alloc_page() may fail. To handle alloc_page() failures, this patch adds an extra page to disk_info. When alloc_page fails, handle_stripe() trys to use these pages. When these pages are used by other stripe (R5C_EXTRA_PAGE_IN_USE), the stripe is added to delayed_list. Signed-off-by: Song Liu <songliubraving@fb.com> Reviewed-by: NeilBrown <neilb@suse.com> Signed-off-by: Shaohua Li <shli@fb.com>
Diffstat (limited to 'drivers/md/raid5.h')
-rw-r--r--drivers/md/raid5.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/md/raid5.h b/drivers/md/raid5.h
index d13fe45d6960..ed8e1362ab36 100644
--- a/drivers/md/raid5.h
+++ b/drivers/md/raid5.h
@@ -276,6 +276,7 @@ struct stripe_head_state {
struct md_rdev *blocked_rdev;
int handle_bad_blocks;
int log_failed;
+ int waiting_extra_page;
};
/* Flags for struct r5dev.flags */
@@ -439,6 +440,7 @@ enum {
struct disk_info {
struct md_rdev *rdev, *replacement;
+ struct page *extra_page; /* extra page to use in prexor */
};
/*
@@ -559,6 +561,9 @@ enum r5_cache_state {
* only process stripes that are already
* occupying the log
*/
+ R5C_EXTRA_PAGE_IN_USE, /* a stripe is using disk_info.extra_page
+ * for prexor
+ */
};
struct r5conf {
@@ -765,6 +770,7 @@ extern void
r5c_finish_stripe_write_out(struct r5conf *conf, struct stripe_head *sh,
struct stripe_head_state *s);
extern void r5c_release_extra_page(struct stripe_head *sh);
+extern void r5c_use_extra_page(struct stripe_head *sh);
extern void r5l_wake_reclaim(struct r5l_log *log, sector_t space);
extern void r5c_handle_cached_data_endio(struct r5conf *conf,
struct stripe_head *sh, int disks, struct bio_list *return_bi);