diff options
author | Song Liu <songliubraving@fb.com> | 2017-01-24 10:45:30 -0800 |
---|---|---|
committer | Shaohua Li <shli@fb.com> | 2017-01-24 11:26:06 -0800 |
commit | 2e38a37f23c98d7fad87ff022670060b8a0e2bf5 (patch) | |
tree | 0cc010718f63769debe1e45f7ff20bffc6db0b88 /drivers/md/raid5.h | |
parent | 07e83364845e1e1c7e189a01206a9d7d33831568 (diff) | |
download | linux-stable-2e38a37f23c98d7fad87ff022670060b8a0e2bf5.tar.gz linux-stable-2e38a37f23c98d7fad87ff022670060b8a0e2bf5.tar.bz2 linux-stable-2e38a37f23c98d7fad87ff022670060b8a0e2bf5.zip |
md/r5cache: disable write back for degraded array
write-back cache in degraded mode introduces corner cases to the array.
Although we try to cover all these corner cases, it is safer to just
disable write-back cache when the array is in degraded mode.
In this patch, we disable writeback cache for degraded mode:
1. On device failure, if the array enters degraded mode, raid5_error()
will submit async job r5c_disable_writeback_async to disable
writeback;
2. In r5c_journal_mode_store(), it is invalid to enable writeback in
degraded mode;
3. In r5c_try_caching_write(), stripes with s->failed>0 will be handled
in write-through mode.
Signed-off-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Shaohua Li <shli@fb.com>
Diffstat (limited to 'drivers/md/raid5.h')
-rw-r--r-- | drivers/md/raid5.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/md/raid5.h b/drivers/md/raid5.h index 461df197d157..1440fa26e296 100644 --- a/drivers/md/raid5.h +++ b/drivers/md/raid5.h @@ -758,6 +758,7 @@ extern sector_t raid5_compute_sector(struct r5conf *conf, sector_t r_sector, extern struct stripe_head * raid5_get_active_stripe(struct r5conf *conf, sector_t sector, int previous, int noblock, int noquiesce); +extern int raid5_calc_degraded(struct r5conf *conf); extern int r5l_init_log(struct r5conf *conf, struct md_rdev *rdev); extern void r5l_exit_log(struct r5l_log *log); extern int r5l_write_stripe(struct r5l_log *log, struct stripe_head *head_sh); @@ -786,4 +787,5 @@ extern void r5c_flush_cache(struct r5conf *conf, int num); extern void r5c_check_stripe_cache_usage(struct r5conf *conf); extern void r5c_check_cached_full_stripe(struct r5conf *conf); extern struct md_sysfs_entry r5c_journal_mode; +extern void r5c_update_on_rdev_error(struct mddev *mddev); #endif |