linux/drivers/mtd
Tejun Heo 731edacb75 mtd: fix bdev exclusive open bugs in block2mtd::add_device()
There are two bdev exclusive open bugs.

* open_bdev_exclusive() must not be called with NULL holder.  Use dev
  as the holder.

* open_by_devnum() doesn't open the bdev exclusively but
  block2mtd_free_device() always assumes it.  Explicitly claim the
  bdev.

The latter is rather clumsy but will be simplified with future
blkdev_get/put() cleanups.

- Updated to use local variable @mode to cache FMODE_* masks as
  suggested by Artem Bityutskiy.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: linux-mtd@lists.infradead.org
Cc: Artem Bityutskiy <dedekind1@gmail.com>
2010-11-13 11:55:16 +01:00
..
chips Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git 2010-10-30 12:35:11 +01:00
devices mtd: fix bdev exclusive open bugs in block2mtd::add_device() 2010-11-13 11:55:16 +01:00
lpddr mtd: change struct flchip_shared spinlock locking into mutex 2010-08-06 09:22:16 +01:00
maps Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git 2010-10-30 12:35:11 +01:00
nand Merge git://git.infradead.org/mtd-2.6 2010-10-30 08:31:35 -07:00
onenand mtd: OneNAND: S5PC110: Fix double call suspend & resume function 2010-10-25 01:36:14 +01:00
tests mtd: tests: return -1 if verify failed 2010-08-02 09:06:20 +01:00
ubi Merge branch 'linux-next' of git://git.infradead.org/ubi-2.6 2010-10-22 16:34:23 -07:00
Kconfig mtd: update description on sm_ftl 2010-08-06 09:21:40 +01:00
Makefile Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 2010-05-10 14:32:46 +01:00
afs.c mtd: Update copyright notices 2010-08-08 20:58:20 +01:00
ar7part.c
cmdlinepart.c mtd: Update copyright notices 2010-08-08 20:58:20 +01:00
ftl.c Update broken web addresses in the kernel. 2010-10-18 11:03:14 +02:00
inftlcore.c mtd: Update copyright notices 2010-08-08 20:58:20 +01:00
inftlmount.c mtd: Remove obsolete <mtd/compatmac.h> include 2010-08-08 21:19:42 +01:00
mtd_blkdevs.c mtd: Remove redundant mutex from mtd_blkdevs.c 2010-10-30 12:39:21 +01:00
mtdblock.c mtd: Update copyright notices 2010-08-08 20:58:20 +01:00
mtdblock_ro.c mtd: Update copyright notices 2010-08-08 20:58:20 +01:00
mtdchar.c Merge git://git.infradead.org/mtd-2.6 2010-10-30 08:31:35 -07:00
mtdconcat.c mtd: Update copyright notices 2010-08-08 20:58:20 +01:00
mtdcore.c mtd: Remove obsolete <mtd/compatmac.h> include 2010-08-08 21:19:42 +01:00
mtdcore.h
mtdoops.c mtd: Update copyright notices 2010-08-08 20:58:20 +01:00
mtdpart.c mtd: prepare partition add and del functions for ioctl requests 2010-10-25 00:47:37 +01:00
mtdsuper.c convert get_sb_mtd() users to ->mount() 2010-10-29 04:16:26 -04:00
nftlcore.c mtd: Update copyright notices 2010-08-08 20:58:20 +01:00
nftlmount.c mtd: Update copyright notices 2010-08-08 20:58:20 +01:00
ofpart.c mtd: Fix endianness issues from device tree 2010-10-25 00:55:56 +01:00
redboot.c mtd: Update copyright notices 2010-08-08 20:58:20 +01:00
rfd_ftl.c mtd: Update copyright notices 2010-08-08 20:58:20 +01:00
sm_ftl.c bitops: rename for_each_bit() to for_each_set_bit(): mtd 2010-04-08 09:42:41 +01:00
sm_ftl.h mtd: sm_ftl: cosmetic, use bool when possible 2010-10-25 01:33:08 +01:00
ssfdc.c mtd: Update copyright notices 2010-08-08 20:58:20 +01:00