From: Greg Kroah-Hartman Date: Tue, 28 Nov 2017 09:06:00 +0000 (+0100) Subject: drop bcache-only-permit-to-recovery-read-error-when-cache-device-is-clean.patch X-Git-Tag: v3.18.85~10 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=96f1d8b70750b77f7c8ed1a8cb8f482c42a1f558;p=thirdparty%2Fkernel%2Fstable-queue.git drop bcache-only-permit-to-recovery-read-error-when-cache-device-is-clean.patch --- diff --git a/queue-3.18/bcache-only-permit-to-recovery-read-error-when-cache-device-is-clean.patch b/queue-3.18/bcache-only-permit-to-recovery-read-error-when-cache-device-is-clean.patch deleted file mode 100644 index bc86d8bb120..00000000000 --- a/queue-3.18/bcache-only-permit-to-recovery-read-error-when-cache-device-is-clean.patch +++ /dev/null @@ -1,76 +0,0 @@ -From d59b23795933678c9638fd20c942d2b4f3cd6185 Mon Sep 17 00:00:00 2001 -From: Coly Li -Date: Mon, 30 Oct 2017 14:46:31 -0700 -Subject: bcache: only permit to recovery read error when cache device is clean - -From: Coly Li - -commit d59b23795933678c9638fd20c942d2b4f3cd6185 upstream. - -When bcache does read I/Os, for example in writeback or writethrough mode, -if a read request on cache device is failed, bcache will try to recovery -the request by reading from cached device. If the data on cached device is -not synced with cache device, then requester will get a stale data. - -For critical storage system like database, providing stale data from -recovery may result an application level data corruption, which is -unacceptible. - -With this patch, for a failed read request in writeback or writethrough -mode, recovery a recoverable read request only happens when cache device -is clean. That is to say, all data on cached device is up to update. - -For other cache modes in bcache, read request will never hit -cached_dev_read_error(), they don't need this patch. - -Please note, because cache mode can be switched arbitrarily in run time, a -writethrough mode might be switched from a writeback mode. Therefore -checking dc->has_data in writethrough mode still makes sense. - -Changelog: -V4: Fix parens error pointed by Michael Lyle. -v3: By response from Kent Oversteet, he thinks recovering stale data is a - bug to fix, and option to permit it is unnecessary. So this version - the sysfs file is removed. -v2: rename sysfs entry from allow_stale_data_on_failure to - allow_stale_data_on_failure, and fix the confusing commit log. -v1: initial patch posted. - -[small change to patch comment spelling by mlyle] - -Signed-off-by: Coly Li -Signed-off-by: Michael Lyle -Reported-by: Arne Wolf -Reviewed-by: Michael Lyle -Cc: Kent Overstreet -Cc: Nix -Cc: Kai Krakow -Cc: Eric Wheeler -Cc: Junhui Tang -Signed-off-by: Jens Axboe -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/md/bcache/request.c | 10 +++++++++- - 1 file changed, 9 insertions(+), 1 deletion(-) - ---- a/drivers/md/bcache/request.c -+++ b/drivers/md/bcache/request.c -@@ -705,8 +705,16 @@ static void cached_dev_read_error(struct - { - struct search *s = container_of(cl, struct search, cl); - struct bio *bio = &s->bio.bio; -+ struct cached_dev *dc = container_of(s->d, struct cached_dev, disk); - -- if (s->recoverable) { -+ /* -+ * If cache device is dirty (dc->has_dirty is non-zero), then -+ * recovery a failed read request from cached device may get a -+ * stale data back. So read failure recovery is only permitted -+ * when cache device is clean. -+ */ -+ if (s->recoverable && -+ (dc && !atomic_read(&dc->has_dirty))) { - /* Retry from the backing device: */ - trace_bcache_read_retry(s->orig_bio); - diff --git a/queue-3.18/series b/queue-3.18/series index 3daac3401c8..576197cf276 100644 --- a/queue-3.18/series +++ b/queue-3.18/series @@ -13,7 +13,6 @@ autofs-don-t-fail-mount-for-transient-error.patch nilfs2-fix-race-condition-that-causes-file-system-corruption.patch ecryptfs-use-after-free-in-ecryptfs_release_messaging.patch bcache-check-ca-alloc_thread-initialized-before-wake-up-it.patch -bcache-only-permit-to-recovery-read-error-when-cache-device-is-clean.patch isofs-fix-timestamps-beyond-2027.patch nfs-fix-typo-in-nomigration-mount-option.patch nfs-fix-ugly-referral-attributes.patch diff --git a/queue-4.14/bcache-only-permit-to-recovery-read-error-when-cache-device-is-clean.patch b/queue-4.14/bcache-only-permit-to-recovery-read-error-when-cache-device-is-clean.patch deleted file mode 100644 index 112bf749588..00000000000 --- a/queue-4.14/bcache-only-permit-to-recovery-read-error-when-cache-device-is-clean.patch +++ /dev/null @@ -1,76 +0,0 @@ -From d59b23795933678c9638fd20c942d2b4f3cd6185 Mon Sep 17 00:00:00 2001 -From: Coly Li -Date: Mon, 30 Oct 2017 14:46:31 -0700 -Subject: bcache: only permit to recovery read error when cache device is clean - -From: Coly Li - -commit d59b23795933678c9638fd20c942d2b4f3cd6185 upstream. - -When bcache does read I/Os, for example in writeback or writethrough mode, -if a read request on cache device is failed, bcache will try to recovery -the request by reading from cached device. If the data on cached device is -not synced with cache device, then requester will get a stale data. - -For critical storage system like database, providing stale data from -recovery may result an application level data corruption, which is -unacceptible. - -With this patch, for a failed read request in writeback or writethrough -mode, recovery a recoverable read request only happens when cache device -is clean. That is to say, all data on cached device is up to update. - -For other cache modes in bcache, read request will never hit -cached_dev_read_error(), they don't need this patch. - -Please note, because cache mode can be switched arbitrarily in run time, a -writethrough mode might be switched from a writeback mode. Therefore -checking dc->has_data in writethrough mode still makes sense. - -Changelog: -V4: Fix parens error pointed by Michael Lyle. -v3: By response from Kent Oversteet, he thinks recovering stale data is a - bug to fix, and option to permit it is unnecessary. So this version - the sysfs file is removed. -v2: rename sysfs entry from allow_stale_data_on_failure to - allow_stale_data_on_failure, and fix the confusing commit log. -v1: initial patch posted. - -[small change to patch comment spelling by mlyle] - -Signed-off-by: Coly Li -Signed-off-by: Michael Lyle -Reported-by: Arne Wolf -Reviewed-by: Michael Lyle -Cc: Kent Overstreet -Cc: Nix -Cc: Kai Krakow -Cc: Eric Wheeler -Cc: Junhui Tang -Signed-off-by: Jens Axboe -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/md/bcache/request.c | 10 +++++++++- - 1 file changed, 9 insertions(+), 1 deletion(-) - ---- a/drivers/md/bcache/request.c -+++ b/drivers/md/bcache/request.c -@@ -698,8 +698,16 @@ static void cached_dev_read_error(struct - { - struct search *s = container_of(cl, struct search, cl); - struct bio *bio = &s->bio.bio; -+ struct cached_dev *dc = container_of(s->d, struct cached_dev, disk); - -- if (s->recoverable) { -+ /* -+ * If cache device is dirty (dc->has_dirty is non-zero), then -+ * recovery a failed read request from cached device may get a -+ * stale data back. So read failure recovery is only permitted -+ * when cache device is clean. -+ */ -+ if (s->recoverable && -+ (dc && !atomic_read(&dc->has_dirty))) { - /* Retry from the backing device: */ - trace_bcache_read_retry(s->orig_bio); - diff --git a/queue-4.14/series b/queue-4.14/series index fc7d7bd8f5c..8619b1390bb 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -59,7 +59,6 @@ fscrypt-lock-mutex-before-checking-for-bounce-page-pool.patch ecryptfs-use-after-free-in-ecryptfs_release_messaging.patch libceph-don-t-warn-if-user-tries-to-add-invalid-key.patch bcache-check-ca-alloc_thread-initialized-before-wake-up-it.patch -bcache-only-permit-to-recovery-read-error-when-cache-device-is-clean.patch fs-guard_bio_eod-needs-to-consider-partitions.patch fanotify-fix-fsnotify_prepare_user_wait-failure.patch isofs-fix-timestamps-beyond-2027.patch diff --git a/queue-4.4/bcache-only-permit-to-recovery-read-error-when-cache-device-is-clean.patch b/queue-4.4/bcache-only-permit-to-recovery-read-error-when-cache-device-is-clean.patch deleted file mode 100644 index 73039d84ce1..00000000000 --- a/queue-4.4/bcache-only-permit-to-recovery-read-error-when-cache-device-is-clean.patch +++ /dev/null @@ -1,76 +0,0 @@ -From d59b23795933678c9638fd20c942d2b4f3cd6185 Mon Sep 17 00:00:00 2001 -From: Coly Li -Date: Mon, 30 Oct 2017 14:46:31 -0700 -Subject: bcache: only permit to recovery read error when cache device is clean - -From: Coly Li - -commit d59b23795933678c9638fd20c942d2b4f3cd6185 upstream. - -When bcache does read I/Os, for example in writeback or writethrough mode, -if a read request on cache device is failed, bcache will try to recovery -the request by reading from cached device. If the data on cached device is -not synced with cache device, then requester will get a stale data. - -For critical storage system like database, providing stale data from -recovery may result an application level data corruption, which is -unacceptible. - -With this patch, for a failed read request in writeback or writethrough -mode, recovery a recoverable read request only happens when cache device -is clean. That is to say, all data on cached device is up to update. - -For other cache modes in bcache, read request will never hit -cached_dev_read_error(), they don't need this patch. - -Please note, because cache mode can be switched arbitrarily in run time, a -writethrough mode might be switched from a writeback mode. Therefore -checking dc->has_data in writethrough mode still makes sense. - -Changelog: -V4: Fix parens error pointed by Michael Lyle. -v3: By response from Kent Oversteet, he thinks recovering stale data is a - bug to fix, and option to permit it is unnecessary. So this version - the sysfs file is removed. -v2: rename sysfs entry from allow_stale_data_on_failure to - allow_stale_data_on_failure, and fix the confusing commit log. -v1: initial patch posted. - -[small change to patch comment spelling by mlyle] - -Signed-off-by: Coly Li -Signed-off-by: Michael Lyle -Reported-by: Arne Wolf -Reviewed-by: Michael Lyle -Cc: Kent Overstreet -Cc: Nix -Cc: Kai Krakow -Cc: Eric Wheeler -Cc: Junhui Tang -Signed-off-by: Jens Axboe -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/md/bcache/request.c | 10 +++++++++- - 1 file changed, 9 insertions(+), 1 deletion(-) - ---- a/drivers/md/bcache/request.c -+++ b/drivers/md/bcache/request.c -@@ -707,8 +707,16 @@ static void cached_dev_read_error(struct - { - struct search *s = container_of(cl, struct search, cl); - struct bio *bio = &s->bio.bio; -+ struct cached_dev *dc = container_of(s->d, struct cached_dev, disk); - -- if (s->recoverable) { -+ /* -+ * If cache device is dirty (dc->has_dirty is non-zero), then -+ * recovery a failed read request from cached device may get a -+ * stale data back. So read failure recovery is only permitted -+ * when cache device is clean. -+ */ -+ if (s->recoverable && -+ (dc && !atomic_read(&dc->has_dirty))) { - /* Retry from the backing device: */ - trace_bcache_read_retry(s->orig_bio); - diff --git a/queue-4.4/series b/queue-4.4/series index 00ef5727cc2..f213b98bc50 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -21,7 +21,6 @@ autofs-don-t-fail-mount-for-transient-error.patch nilfs2-fix-race-condition-that-causes-file-system-corruption.patch ecryptfs-use-after-free-in-ecryptfs_release_messaging.patch bcache-check-ca-alloc_thread-initialized-before-wake-up-it.patch -bcache-only-permit-to-recovery-read-error-when-cache-device-is-clean.patch isofs-fix-timestamps-beyond-2027.patch nfs-fix-typo-in-nomigration-mount-option.patch nfs-fix-ugly-referral-attributes.patch diff --git a/queue-4.9/bcache-only-permit-to-recovery-read-error-when-cache-device-is-clean.patch b/queue-4.9/bcache-only-permit-to-recovery-read-error-when-cache-device-is-clean.patch deleted file mode 100644 index decc6c86456..00000000000 --- a/queue-4.9/bcache-only-permit-to-recovery-read-error-when-cache-device-is-clean.patch +++ /dev/null @@ -1,76 +0,0 @@ -From d59b23795933678c9638fd20c942d2b4f3cd6185 Mon Sep 17 00:00:00 2001 -From: Coly Li -Date: Mon, 30 Oct 2017 14:46:31 -0700 -Subject: bcache: only permit to recovery read error when cache device is clean - -From: Coly Li - -commit d59b23795933678c9638fd20c942d2b4f3cd6185 upstream. - -When bcache does read I/Os, for example in writeback or writethrough mode, -if a read request on cache device is failed, bcache will try to recovery -the request by reading from cached device. If the data on cached device is -not synced with cache device, then requester will get a stale data. - -For critical storage system like database, providing stale data from -recovery may result an application level data corruption, which is -unacceptible. - -With this patch, for a failed read request in writeback or writethrough -mode, recovery a recoverable read request only happens when cache device -is clean. That is to say, all data on cached device is up to update. - -For other cache modes in bcache, read request will never hit -cached_dev_read_error(), they don't need this patch. - -Please note, because cache mode can be switched arbitrarily in run time, a -writethrough mode might be switched from a writeback mode. Therefore -checking dc->has_data in writethrough mode still makes sense. - -Changelog: -V4: Fix parens error pointed by Michael Lyle. -v3: By response from Kent Oversteet, he thinks recovering stale data is a - bug to fix, and option to permit it is unnecessary. So this version - the sysfs file is removed. -v2: rename sysfs entry from allow_stale_data_on_failure to - allow_stale_data_on_failure, and fix the confusing commit log. -v1: initial patch posted. - -[small change to patch comment spelling by mlyle] - -Signed-off-by: Coly Li -Signed-off-by: Michael Lyle -Reported-by: Arne Wolf -Reviewed-by: Michael Lyle -Cc: Kent Overstreet -Cc: Nix -Cc: Kai Krakow -Cc: Eric Wheeler -Cc: Junhui Tang -Signed-off-by: Jens Axboe -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/md/bcache/request.c | 10 +++++++++- - 1 file changed, 9 insertions(+), 1 deletion(-) - ---- a/drivers/md/bcache/request.c -+++ b/drivers/md/bcache/request.c -@@ -702,8 +702,16 @@ static void cached_dev_read_error(struct - { - struct search *s = container_of(cl, struct search, cl); - struct bio *bio = &s->bio.bio; -+ struct cached_dev *dc = container_of(s->d, struct cached_dev, disk); - -- if (s->recoverable) { -+ /* -+ * If cache device is dirty (dc->has_dirty is non-zero), then -+ * recovery a failed read request from cached device may get a -+ * stale data back. So read failure recovery is only permitted -+ * when cache device is clean. -+ */ -+ if (s->recoverable && -+ (dc && !atomic_read(&dc->has_dirty))) { - /* Retry from the backing device: */ - trace_bcache_read_retry(s->orig_bio); - diff --git a/queue-4.9/series b/queue-4.9/series index 8461dfac41e..77733a15741 100644 --- a/queue-4.9/series +++ b/queue-4.9/series @@ -31,7 +31,6 @@ nilfs2-fix-race-condition-that-causes-file-system-corruption.patch ecryptfs-use-after-free-in-ecryptfs_release_messaging.patch libceph-don-t-warn-if-user-tries-to-add-invalid-key.patch bcache-check-ca-alloc_thread-initialized-before-wake-up-it.patch -bcache-only-permit-to-recovery-read-error-when-cache-device-is-clean.patch isofs-fix-timestamps-beyond-2027.patch nfs-fix-typo-in-nomigration-mount-option.patch nfs-fix-ugly-referral-attributes.patch