linux/drivers
Vladimir Davydov 53d85c9856 cleancache: forbid overriding cleancache_ops
Currently, cleancache_register_ops returns the previous value of
cleancache_ops to allow chaining.  However, chaining, as it is
implemented now, is extremely dangerous due to possible pool id
collisions.  Suppose, a new cleancache driver is registered after the
previous one assigned an id to a super block.  If the new driver assigns
the same id to another super block, which is perfectly possible, we will
have two different filesystems using the same id.  No matter if the new
driver implements chaining or not, we are likely to get data corruption
with such a configuration eventually.

This patch therefore disables the ability to override cleancache_ops
altogether as potentially dangerous.  If there is already cleancache
driver registered, all further calls to cleancache_register_ops will
return EBUSY.  Since no user of cleancache implements chaining, we only
need to make minor changes to the code outside the cleancache core.

Signed-off-by: Vladimir Davydov <vdavydov@parallels.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: David Vrabel <david.vrabel@citrix.com>
Cc: Mark Fasheh <mfasheh@suse.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Stefan Hengelein <ilendir@googlemail.com>
Cc: Florian Schmaus <fschmaus@gmail.com>
Cc: Andor Daam <andor.daam@googlemail.com>
Cc: Dan Magenheimer <dan.magenheimer@oracle.com>
Cc: Bob Liu <lliubbo@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-04-14 16:49:03 -07:00
..
accessibility
acpi ACPI / battery: Fix doubly added battery on system suspend 2015-04-14 09:03:33 -07:00
amba
android
ata Merge branch 'for-4.1' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata 2015-04-13 16:42:16 -07:00
atm
auxdisplay
base mm, hotplug: fix concurrent memory hot-add deadlock 2015-04-14 16:49:00 -07:00
bcma
block Merge branch 'linus' into irq/core to get the GIC updates which 2015-04-08 23:26:21 +02:00
bluetooth
bus
cdrom
char ipmi_ssif: Use interruptible completion for waiting in the thread 2015-04-10 20:51:42 -05:00
clk The clk fixes for 4.0-rc4 comprise three themes. First are the usual 2015-03-15 15:07:08 -07:00
clocksource ARM, clocksource/drivers: Provide read_boot_clock64() and read_persistent_clock64() and use them 2015-04-03 08:18:23 +02:00
connector
coresight
cpufreq cpufreq: Schedule work for the first-online CPU on resume 2015-04-03 12:59:47 +02:00
cpuidle Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2015-04-13 11:08:28 -07:00
crypto
dca
devfreq
dio
dma Staging driver patches for 4.1-rc1 2015-04-13 17:37:33 -07:00
dma-buf
edac EDAC: Constify of_device_id array 2015-03-20 17:50:07 +01:00
eisa
extcon
firewire
firmware Merge branch 'core-efi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2015-04-13 10:22:30 -07:00
fmc
gpio gpio: syscon: reduce message level when direction reg offset not in dt 2015-03-27 11:17:08 +01:00
gpu regulator: Updates for v4.1 2015-04-13 15:13:25 -07:00
hid power supply and reset changes for the v4.1 series 2015-04-13 15:21:34 -07:00
hsi HSI: cmt_speech: fix error return code 2015-04-05 14:45:27 +02:00
hv
hwmon hwmon: (pwm-fan) Update the duty cycle inorder to control the pwm-fan 2015-04-12 15:59:11 -07:00
hwspinlock
i2c Revert "i2c: core: Dispose OF IRQ mapping at client removal time" 2015-03-12 10:23:05 +01:00
ide Merge branch 'for-4.1' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata 2015-04-13 16:42:16 -07:00
idle intel_idle: Use explicit broadcast oneshot control function 2015-04-03 08:44:35 +02:00
iio Staging driver patches for 4.1-rc1 2015-04-13 17:37:33 -07:00
infiniband IB/uverbs: Prevent integer overflow in ib_umem_get address arithmetic 2015-04-02 09:53:59 -07:00
input Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2015-04-06 14:10:08 -07:00
iommu PCI changes for the v4.1 merge window: 2015-04-13 15:45:47 -07:00
ipack
irqchip irqchip core change for v4.1 (round 3) 2015-04-11 11:17:28 +02:00
isdn isdn: icn: use strlcpy() when parsing setup options 2015-03-15 22:24:37 -04:00
leds
lguest lguest: now needs PCI_DIRECT. 2015-04-01 10:29:05 -07:00
macintosh
mailbox
mcb
md md/raid0: fix bug with chunksize not a power of 2. 2015-04-10 15:36:31 +10:00
media [media] rtl28xxu: return success for unimplemented FE callback 2015-04-02 18:27:14 -03:00
memory
memstick
message
mfd power supply and reset changes for the v4.1 series 2015-04-13 15:21:34 -07:00
misc Merge branch 'x86-asm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2015-04-13 13:16:36 -07:00
mmc mmc: sdhci-st: Update the quirks for this controller. 2015-04-10 12:55:40 +02:00
mtd Merge branch 'linus' into irq/core to get the GIC updates which 2015-04-08 23:26:21 +02:00
net net/mlx4_core: Fix error message deprecation for ConnectX-2 cards 2015-04-06 17:32:27 -04:00
nfc
ntb
nubus
of PCI changes for the v4.1 merge window: 2015-04-13 15:45:47 -07:00
oprofile
parisc
parport
pci PCI changes for the v4.1 merge window: 2015-04-13 15:45:47 -07:00
pcmcia Revert "pcmcia: add a new resource manager for non ISA systems" 2015-03-11 14:21:23 +01:00
phy USB patches for 4.1-rc1 2015-04-13 17:07:21 -07:00
pinctrl pinctrl: sun4i: GPIOs configured as irq must be set to input before reading 2015-03-18 10:56:46 +01:00
platform power_supply: Change ownership from driver to core 2015-03-13 23:15:51 +01:00
pnp PNP: Don't check for overlaps with unassigned PCI BARs 2015-03-12 12:30:00 -05:00
power power: twl4030_madc_battery: Add missing MODULE_ALIAS 2015-04-06 19:39:57 +02:00
powercap powercap / RAPL: handle domains with different energy units 2015-03-13 23:18:44 +01:00
pps
ps3
ptp
pwm
rapidio
ras
regulator Merge remote-tracking branch 'regulator/topic/wm8350' into regulator-next 2015-04-10 19:16:06 +01:00
remoteproc
reset
rpmsg virtio_rpmsg: set DRIVER_OK before using device 2015-03-13 15:55:42 +10:30
rtc time, drivers/rtc: Don't bother with rtc_resume() for the nonstop clocksource 2015-04-03 08:18:34 +02:00
s390
sbus
scsi Merge branch 'for-4.1' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata 2015-04-13 16:42:16 -07:00
sfi
sh
sn
soc
spi Merge remote-tracking branches 'spi/topic/spidev' and 'spi/topic/spidev-test' into spi-next 2015-04-11 23:09:31 +01:00
spmi
ssb
staging page_writeback: clean up mess around cancel_dirty_page() 2015-04-14 16:49:01 -07:00
target iscsi target: fix oops when adding reject pdu 2015-04-10 12:33:55 -07:00
tc
thermal drivers: thermal: st: remove several sparse warnings 2015-04-07 13:43:28 -07:00
thunderbolt
tty Merge branch 'for-4.1' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq 2015-04-13 16:19:18 -07:00
uio
usb USB patches for 4.1-rc1 2015-04-13 17:07:21 -07:00
uwb uwb: Remove umc bus legacy suspend/resume support 2015-03-18 17:27:03 +01:00
vfio vfio-pci: Add missing break to enable VFIO_PCI_ERR_IRQ_INDEX 2015-03-12 09:51:38 -06:00
vhost Merge git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending 2015-03-21 11:24:38 -07:00
video
virt
virtio virtio_mmio: fix access width for mmio 2015-03-17 12:12:21 +10:30
vlynq
vme
w1
watchdog watchdog: imgpdc: Fix default heartbeat 2015-03-27 08:47:50 +01:00
xen cleancache: forbid overriding cleancache_ops 2015-04-14 16:49:03 -07:00
zorro
Kconfig
Makefile