linux/drivers
Alex Elder b82d167be6 rbd: prevent open for image being removed
An open request for a mapped rbd image can arrive while removal of
that mapping is underway.  We need to prevent such an open request
from succeeding.  (It appears that Maciej Galkiewicz ran into this
problem.)

Define and use a "removing" flag to indicate a mapping is getting
removed.  Set it in the remove path after verifying nothing holds
the device open.  And check it in the open path before allowing the
open to proceed.  Acquire the rbd device's lock around each of these
spots to avoid any races accessing the flags and open_count fields.

This addresses:
    http://tracker.newdream.net/issues/3427

Reported-by: Maciej Galkiewicz <maciejgalkiewicz@ragnarson.com>
Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
2013-02-13 18:29:10 -08:00
..
accessibility
acpi ACPI: Check MSR valid bit before using P-state frequencies 2013-01-22 13:37:21 +01:00
amba
ata [libata] replace sata_settings with devslp_timing 2013-01-14 13:29:15 -05:00
atm
auxdisplay
base Merge remote-tracking branch 'regmap/fix/debugfs' into tmp 2013-01-24 19:04:16 +08:00
bcma Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2013-01-08 07:31:49 -08:00
block rbd: prevent open for image being removed 2013-02-13 18:29:10 -08:00
bluetooth
bus
cdrom
char
clk mvebu fixes for v3.8-rc5 2013-01-23 20:30:52 -08:00
clocksource
connector
cpufreq cpufreq: Add module aliases for acpi-cpufreq 2013-01-22 22:33:46 +01:00
cpuidle cpuidle: remove the power_specified field in the driver 2013-01-15 14:18:04 +01:00
crypto
dca
devfreq PM / devfreq: exynos4_bus: honor RCU lock usage 2013-01-22 13:28:40 +01:00
dio
dma Merge branch 'fixes' of git://git.infradead.org/users/vkoul/slave-dma 2013-01-24 10:17:49 -08:00
edac Two error path fixes causing a crash and a Kconfig fix for an issue 2013-01-09 08:43:56 -08:00
eisa
extcon
firewire
firmware
gpio gpio: mvebu: Don't free chip label memory 2013-01-17 12:27:08 +01:00
gpu ttm: on move memory failure don't leave a node dangling 2013-01-21 13:45:23 +10:00
hid
hsi
hv Drivers: hv: balloon: Fix a memory leak 2013-01-17 11:58:00 -08:00
hwmon hwmon: (vexpress) Fix build error seen if CONFIG_OF_DEVICE is not set 2013-01-09 21:47:22 -08:00
hwspinlock
i2c i2c-designware: add missing MODULE_LICENSE 2013-01-22 16:43:34 +01:00
ide
idle intel_idle: Don't register CPU notifier if we are not running. 2013-01-18 13:43:43 +01:00
iio Staging fixes for 3.8-rc3 2013-01-14 09:08:38 -08:00
infiniband
input Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2013-01-04 10:30:11 -08:00
iommu
ipack
irqchip
isdn
leds
lguest
macintosh
md
media ARM: arm-soc: Fixes for 3.8-rc, take 2 2013-01-24 12:42:50 -08:00
memory
memstick
message
mfd mfd: vexpress-sysreg: Don't skip initialization on probe 2013-01-24 12:19:23 +00:00
misc Revert "drivers/misc/ti-st: remove gpio handling" 2013-01-22 17:22:47 -08:00
mmc mvebu fixes for v3.8-rc5 2013-01-23 20:30:52 -08:00
mtd
net be2net: fix unconditionally returning IRQ_HANDLED in INTx 2013-01-12 15:33:01 -08:00
nfc
nubus
of
oprofile
parisc
parport
pci PCI updates for v3.8: 2013-01-22 16:36:23 -08:00
pcmcia
pinctrl ARM: arm-soc fixes for 3.8-rc 2013-01-08 18:53:56 -08:00
platform asus-laptop: Fix potential invalid pointer dereference 2013-01-07 12:33:48 -05:00
pnp
power ARM: arm-soc fixes for 3.8-rc 2013-01-08 18:53:56 -08:00
pps
ps3
ptp
pwm
rapidio
regulator Merge remote-tracking branch 'regulator/fix/s5m8767' into tmp 2013-01-15 09:38:59 +09:00
remoteproc
rpmsg
rtc drivers/rtc/rtc-da9055.c: fix cross-section reference 2013-01-11 14:54:54 -08:00
s390 s390/chsc: fix SEI usage 2013-01-16 15:57:54 +01:00
sbus
scsi
sfi
sh sh: clkfwk: bugfix: sh_clk_div_enable() care sh_clk_div_set_rate() if div6 2013-01-11 20:57:58 +09:00
sn
spi
ssb Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2013-01-08 07:31:49 -08:00
staging Staging bugfixes for 3.8-rc4 2013-01-18 14:05:25 -08:00
target iscsi-target: Fix CmdSN comparison (use cmd->cmd_sn instead of cmd->stat_sn) 2013-01-10 21:00:37 -08:00
tc
thermal
tty 8250/16?50: Add support for Broadcom TruManage redirected serial port 2013-01-17 14:02:55 -08:00
uio
usb USB: EHCI: fix build error in ehci-mxc 2013-01-23 11:27:08 -08:00
uwb
vfio vfio-pci: Fix buffer overfill 2013-01-15 10:45:26 -07:00
vhost
video This is yet another critical imxfb fixes held off by absence of FB 2013-01-23 20:35:02 -08:00
virt
virtio
vlynq
vme
w1
watchdog
xen Fixes: 2013-01-18 12:02:52 -08:00
zorro
Kconfig
Makefile