From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
stable@vger.kernel.org, Bill <billstuff2001@sbcglobal.net>,
NeilBrown <neilb@suse.de>
Subject: [PATCH 3.10 43/53] md: flush writes before starting a recovery.
Date: Mon, 7 Jul 2014 16:58:28 -0700 [thread overview]
Message-ID: <20140707235830.600382447@linuxfoundation.org> (raw)
In-Reply-To: <20140707235829.281783607@linuxfoundation.org>
3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: NeilBrown <neilb@suse.de>
commit 133d4527eab8d199a62eee6bd433f0776842df2e upstream.
When we write to a degraded array which has a bitmap, we
make sure the relevant bit in the bitmap remains set when
the write completes (so a 're-add' can quickly rebuilt a
temporarily-missing device).
If, immediately after such a write starts, we incorporate a spare,
commence recovery, and skip over the region where the write is
happening (because the 'needs recovery' flag isn't set yet),
then that write will not get to the new device.
Once the recovery finishes the new device will be trusted, but will
have incorrect data, leading to possible corruption.
We cannot set the 'needs recovery' flag when we start the write as we
do not know easily if the write will be "degraded" or not. That
depends on details of the particular raid level and particular write
request.
This patch fixes a corruption issue of long standing and so it
suitable for any -stable kernel. It applied correctly to 3.0 at
least and will minor editing to earlier kernels.
Reported-by: Bill <billstuff2001@sbcglobal.net>
Tested-by: Bill <billstuff2001@sbcglobal.net>
Link: http://lkml.kernel.org/r/53A518BB.60709@sbcglobal.net
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/md/md.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -7447,6 +7447,19 @@ void md_do_sync(struct md_thread *thread
rdev->recovery_offset < j)
j = rdev->recovery_offset;
rcu_read_unlock();
+
+ /* If there is a bitmap, we need to make sure all
+ * writes that started before we added a spare
+ * complete before we start doing a recovery.
+ * Otherwise the write might complete and (via
+ * bitmap_endwrite) set a bit in the bitmap after the
+ * recovery has checked that bit and skipped that
+ * region.
+ */
+ if (mddev->bitmap) {
+ mddev->pers->quiesce(mddev, 1);
+ mddev->pers->quiesce(mddev, 0);
+ }
}
printk(KERN_INFO "md: %s of RAID array %s\n", desc, mdname(mddev));
next prev parent reply other threads:[~2014-07-07 23:59 UTC|newest]
Thread overview: 53+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-07 23:57 [PATCH 3.10 00/53] 3.10.48-stable review Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.10 01/53] ibmvscsi: Abort init sequence during error recovery Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.10 02/53] ibmvscsi: Add memory barriers for send / receive Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.10 03/53] virtio-scsi: avoid cancelling uninitialized work items Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.10 04/53] virtio-scsi: fix various bad behavior on aborted requests Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.10 05/53] xhci: correct burst count field for isoc transfers on 1.0 xhci hosts Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.10 06/53] xhci: Fix runtime suspended xhci from blocking system suspend Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.10 07/53] USB: option: add device ID for SpeedUp SU9800 usb 3g modem Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.10 09/53] USB: ftdi_sio: fix null deref at port probe Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.10 11/53] rt2x00: disable TKIP on USB Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.10 12/53] rt2x00: fix rfkill regression on rt2500pci Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.10 13/53] mtd: eLBC NAND: fix subpage write support Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.10 14/53] mtd: nand: omap: fix BCHx ecc.correct to return detected bit-flips in erased-page Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 15/53] drm/radeon: only apply hdmi bpc pll flags when encoder mode is hdmi Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 16/53] drm/radeon: fix typo in radeon_connector_is_dp12_capable() Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 17/53] drm/radeon/dp: fix lane/clock setup for dp 1.2 capable devices Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 18/53] drm/radeon/atom: fix dithering on certain panels Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 20/53] drm/vmwgfx: Fix incorrect write to read-only register v2: Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 21/53] Bluetooth: Fix SSP acceptor just-works confirmation without MITM Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 22/53] Bluetooth: Fix check for connection encryption Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 23/53] Bluetooth: Fix locking of hdev when calling into SMP code Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 24/53] dm thin: update discard_granularity to reflect the thin-pool blocksize Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 25/53] rbd: use reference counts for image requests Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 26/53] rbd: handle parent_overlap on writes correctly Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 27/53] hwmon: (ina2xx) Cast to s16 on shunt and current regs Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 28/53] mac80211: dont check netdev state for debugfs read/write Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 30/53] iwlwifi: pcie: try to get ownership several times Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 31/53] ARM: OMAP2+: Fix parser-bug in platform muxing code Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 34/53] CIFS: fix mount failure with broken pathnames when smb3 mount with mapchars option Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 35/53] ext4: Fix buffer double free in ext4_alloc_branch() Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 36/53] ext4: Fix hole punching for files with indirect blocks Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 37/53] KVM: x86: Increase the number of fixed MTRR regs to 10 Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 38/53] KVM: x86: preserve the high 32-bits of the PAT register Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 39/53] iio: of_iio_channel_get_by_name() returns non-null pointers for error legs Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 40/53] nfsd: fix rare symlink decoding bug Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 41/53] tools: ffs-test: fix header values endianess Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 42/53] tracing: Remove ftrace_stop/start() from reading the trace file Greg Kroah-Hartman
2014-07-07 23:58 ` Greg Kroah-Hartman [this message]
2014-07-07 23:58 ` [PATCH 3.10 44/53] irqchip: spear_shirq: Fix interrupt offset Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 45/53] mmc: rtsx: add R1-no-CRC mmc command type handle Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 46/53] serial: 8250_dw: Report CTS asserted for auto flow Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 47/53] serial: 8250_dw: Improve unwritable LCR workaround Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 48/53] serial: 8250_dw: Fix LCR workaround regression Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 49/53] ALSA: usb-audio: Suppress repetitive debug messages from retire_playback_urb() Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 50/53] ALSA: usb-audio: Prevent printk ratelimiting from spamming kernel log while DEBUG not defined Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 51/53] arch/unicore32/mm/alignment.c: include "asm/pgtable.h" to avoid compiling error Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 52/53] drivers/video/fbdev/fb-puv3.c: Add header files for function unifb_mmap Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 53/53] sym53c8xx_2: Set DID_REQUEUE return code when aborting squeue Greg Kroah-Hartman
2014-07-08 13:19 ` [PATCH 3.10 00/53] 3.10.48-stable review Guenter Roeck
2014-07-08 22:15 ` Greg Kroah-Hartman
2014-07-09 10:21 ` Luis Henriques
2014-07-15 0:59 ` Greg Kroah-Hartman
2014-07-08 19:31 ` Shuah Khan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140707235830.600382447@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=billstuff2001@sbcglobal.net \
--cc=linux-kernel@vger.kernel.org \
--cc=neilb@suse.de \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).