linux/drivers
Alex Lyakas 0938e135aa md/raid1: consider WRITE as successful only if at least one non-Faulty and non-rebuilding drive completed it.
commit 3056e3aec8 upstream.

Without that fix, the following scenario could happen:

- RAID1 with drives A and B; drive B was freshly-added and is rebuilding
- Drive A fails
- WRITE request arrives to the array. It is failed by drive A, so
r1_bio is marked as R1BIO_WriteError, but the rebuilding drive B
succeeds in writing it, so the same r1_bio is marked as
R1BIO_Uptodate.
- r1_bio arrives to handle_write_finished, badblocks are disabled,
md_error()->error() does nothing because we don't fail the last drive
of raid1
- raid_end_bio_io()  calls call_bio_endio()
- As a result, in call_bio_endio():
        if (!test_bit(R1BIO_Uptodate, &r1_bio->state))
                clear_bit(BIO_UPTODATE, &bio->bi_flags);
this code doesn't clear the BIO_UPTODATE flag, and the whole master
WRITE succeeds, back to the upper layer.

So we returned success to the upper layer, even though we had written
the data onto the rebuilding drive only. But when we want to read the
data back, we would not read from the rebuilding drive, so this data
is lost.

[neilb - applied identical change to raid10 as well]

This bug can result in lost data, so it is suitable for any
-stable kernel.

Signed-off-by: Alex Lyakas <alex@zadarastorage.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-20 11:58:46 -07:00
..
accessibility
acpi ACPI / video: ignore BIOS initial backlight value for HP Pavilion g6 2013-06-13 09:45:00 -07:00
amba
ata libata: make ata_exec_internal_sg honor DMADIR 2013-06-07 12:49:33 -07:00
atm atm/iphase: rename fregt_t -> ffreg_t 2013-02-14 10:49:05 -08:00
auxdisplay
base regmap: cache Fix regcache-rbtree sync 2013-04-12 09:38:43 -07:00
bcma bcma: mips: fix clearing device IRQ 2013-01-17 08:50:41 -08:00
block cciss: fix broken mutex usage in ioctl 2013-06-20 11:58:45 -07:00
bluetooth Bluetooth: Add support for Dell[QCA 0cf3:817a] 2013-04-05 10:04:15 -07:00
cdrom
char ipmi: ipmi_devintf: compat_ioctl method fails to take ipmi_mutex 2013-05-19 10:54:49 -07:00
clk clk: Check parent for NULL in clk_change_rate 2012-07-19 08:58:59 -07:00
clocksource
connector
cpufreq cpufreq / Longhaul: Disable driver by default 2013-05-11 13:48:10 -07:00
cpuidle
crypto crypto: mv_cesa requires on CRYPTO_HASH to build 2012-05-15 01:10:06 +00:00
dca dca: check against empty dca_domains list before unregister provider 2013-02-28 06:59:06 -08:00
devfreq
dio
dma pch_dma: Use GFP_ATOMIC because called from interrupt context 2013-05-19 10:54:48 -07:00
edac EDAC: Test correct variable in ->store function 2013-02-03 18:24:41 -06:00
eisa EISA/PCI: Fix bus res reference 2013-04-12 09:38:44 -07:00
firewire firewire: add minor number range check to fw_device_init() 2013-03-04 06:06:41 +08:00
firmware efivars: Handle duplicate names from get_next_variable() 2013-04-05 10:04:36 -07:00
gpio gpiolib: Don't return -EPROBE_DEFER to sysfs, or for invalid gpios 2012-11-05 09:50:41 +01:00
gpu drm/i915: prefer VBT modes for SVDO-LVDS over EDID 2013-06-20 11:58:45 -07:00
hid HID: usbhid: quirk for Realtek Multi-card reader 2013-04-05 10:04:16 -07:00
hsi
hv Drivers: hv: Cleanup error handling in vmbus_open() 2012-10-31 10:02:58 -07:00
hwmon hwmon: (adm1021) Strengthen chip detection for ADM1021, LM84 and MAX1617 2013-06-13 09:45:01 -07:00
hwspinlock hwspinlock: fix __hwspin_lock_request error path 2013-04-12 09:38:46 -07:00
i2c i2c: designware: always clear interrupts before enabling them 2013-05-24 11:14:22 -07:00
ide
idle
ieee802154
infiniband IPoIB: Fix send lockup due to missed TX completion 2013-03-28 12:12:25 -07:00
input Input: sentelic - only report position of first finger as ST coordinates 2013-01-11 09:06:56 -08:00
iommu iommu/amd: Workaround for ERBT1312 2013-06-07 12:49:48 -07:00
isdn isdn/gigaset: fix zero size border case in debug dump 2013-02-14 10:49:04 -08:00
leds drivers/leds/leds-ot200.c: fix error caused by shifted mask 2013-06-07 12:49:13 -07:00
lguest
macintosh
mca
md md/raid1: consider WRITE as successful only if at least one non-Faulty and non-rebuilding drive completed it. 2013-06-20 11:58:46 -07:00
media media: mantis: fix silly crash case 2013-05-24 11:14:23 -07:00
memstick
message
mfd mfd: adp5520: Restore mode bits on resume 2013-05-07 19:51:57 -07:00
misc SGI-XP: handle non-fatal traps 2013-01-11 09:06:29 -08:00
mmc mmc: atmel-mci: pio hang on block errors 2013-05-07 19:51:57 -07:00
mtd vm: convert mtdchar mmap to vm_iomap_memory() helper 2013-04-25 21:19:56 -07:00
net ath9k: Use minstrel rate control by default 2013-06-20 11:58:44 -07:00
nfc NFC: pn533: Fix mem leak in pn533_in_dep_link_up 2012-12-03 11:47:12 -08:00
nubus
of
oprofile oprofile: perf: use NR_CPUS instead or nr_cpumask_bits for static array 2012-07-16 09:04:21 -07:00
parisc parisc: move definition of PAGE0 to asm/page.h 2012-05-10 15:12:08 -07:00
parport
pci PCI/PM: Fix fallback to PCI_D0 in pci_platform_power_transition() 2013-05-07 19:51:55 -07:00
pcmcia pcmcia/vrc4171: Add missing spinlock init 2013-02-28 06:59:05 -08:00
pinctrl pinctrl: tegra: set low power mode bank width to 2 2012-10-28 10:14:14 -07:00
platform thinkpad-acpi: recognize latest V-Series using DMI_BIOS_VENDOR 2013-06-07 12:49:49 -07:00
pnp pnpacpi: fix incorrect TEST_ALPHA() test 2013-01-11 09:06:29 -08:00
power ab8500_btemp: Demote initcall sequence 2013-03-04 06:06:44 +08:00
pps
ps3
ptp ptp_pch: Add missing #include <linux/slab.h> 2012-05-16 14:44:44 -04:00
rapidio rapidio/tsi721: fix unused variable compiler warning 2012-09-14 10:00:20 -07:00
regulator regulator: wm831x: Set the new rather than old value for DVS VSEL 2013-01-17 08:50:41 -08:00
remoteproc remoteproc: fix a potential NULL-dereference on cleanup 2012-10-07 08:32:28 -07:00
rpmsg rpmsg: fix dependency on initialization order 2012-07-19 08:58:57 -07:00
rtc drivers/rtc/rtc-twl.c: fix missing device_init_wakeup() when booted with device tree 2013-06-20 11:58:43 -07:00
s390 s390/memory hotplug: prevent offline of active memory increments 2013-05-07 19:51:53 -07:00
sbus
scsi SCSI: sd: fix array cache flushing bug causing performance problems 2013-05-19 10:54:39 -07:00
sfi
sh
sn
spi spi/mpc512x-psc: optionally keep PSC SS asserted across xfer segmensts 2013-04-12 09:38:43 -07:00
ssb ssb: implement spurious tone avoidance 2013-04-25 21:19:55 -07:00
staging staging: vt6656: use free_netdev instead of kfree 2013-06-07 12:49:10 -07:00
target iscsi-target: fix heap buffer overflow on error 2013-06-07 12:49:29 -07:00
tc
thermal thermal: return an error on failure to register thermal class 2013-04-12 09:38:47 -07:00
tty TTY: Fix tty miss restart after we turn off flow-control 2013-06-07 12:49:11 -07:00
uio
usb USB: ftdi_sio: Quiet sparse noise about using plain integer was NULL pointer 2013-06-13 09:45:02 -07:00
uwb
vhost vhost/net: fix heads usage of ubuf_info 2013-03-28 12:11:54 -07:00
video fbcon: when font is freed, clear also vc_font.data 2013-05-07 19:51:53 -07:00
virt
virtio virtio: force vring descriptors to be allocated from lowmem 2013-01-11 09:06:47 -08:00
vlynq
w1 w1: fix oops when w1_search is called from netlink connector 2013-03-20 13:04:59 -07:00
watchdog hpwdt: Fix kdump issue in hpwdt 2012-10-02 10:30:08 -07:00
xen xen-pciback: rate limit error messages from xen_pcibk_enable_msi{,x}() 2013-06-13 09:45:02 -07:00
zorro
Kconfig
Makefile