block: fix __blkdev_get() for removable devices
Tejun Heo authored
Commit 0762b8bd

 moved disk_get_part()
in front of recursive get on the whole disk, which caused removable
devices to try disk_get_part() before rescanning after a new media is
inserted, which might fail legit open attempts or give the old
partition.

This patch fixes the problem by moving disk_get_part() after
__blkdev_get() on the whole disk.

This problem was spotted by Borislav Petkov.
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
Tested-by: default avatarBorislav Petkov <petkovbb@gmail.com>
Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
89f97496
Name Last commit Last update
..
9p 9p: fix format warning
adfs vfs: Use const for kernel parser table
affs vfs: Use const for kernel parser table
afs [PATCH] fix ->llseek for more directories
autofs vfs: Use const for kernel parser table
autofs4 autofs4: add miscellaneous device for ioctls
befs befs: annotate fs32 on tests for superblock endianness
bfs [PATCH] fix ->llseek for more directories
cifs cifs: fix renaming one hardlink on top of another
coda Switch to a valid email address...
configfs [PATCH] assorted path_lookup() -> kern_path() conversions
cramfs cramfs: fix named-pipe handling
debugfs integrity: special fs magic
devpts vfs: Use const for kernel parser table
dlm dlm: choose better identifiers
ecryptfs ecryptfs: fix memory corruption when storing crypto info in xattrs
efs [PATCH] switch all filesystems over to d_obtain_alias
exportfs [PATCH] prepare vfs_readdir() callers to returning filldir result
ext2 Merge git://git.kernel.org/pub/scm/linux/kernel/git/viro/bdev
ext3 ext3: fix a bug accessing freed memory in ext3_abort
ext4 delay capable() check in ext4_has_free_blocks()
fat fs: remove prepare_write/commit_write
freevxfs fs/freevxfs/: proper externs
fuse saner FASYNC handling on file close
gfs2 [PATCH] switch all filesystems over to d_obtain_alias
hfs
hfsplus
hostfs
hpfs
hppfs
hugetlbfs
isofs
jbd
jbd2
jffs2
jfs
lockd
minix
msdos
ncpfs
nfs
nfs_common
nfsd
nls
ntfs
ocfs2
omfs
openpromfs
partitions
proc
qnx4
ramfs
reiserfs
romfs
smbfs
sysfs
sysv
ubifs
udf
ufs
vfat
xfs
Kconfig
Kconfig.binfmt
Makefile
aio.c
anon_inodes.c
attr.c
bad_inode.c
binfmt_aout.c
binfmt_elf.c
binfmt_elf_fdpic.c
binfmt_em86.c
binfmt_flat.c
binfmt_misc.c
binfmt_script.c
binfmt_som.c
bio-integrity.c
bio.c
block_dev.c
buffer.c
char_dev.c
compat.c
compat_binfmt_elf.c
compat_ioctl.c
dcache.c
dcookies.c
direct-io.c
dnotify.c
dquot.c
drop_caches.c
eventfd.c
eventpoll.c
exec.c
fcntl.c
fifo.c
file.c
file_table.c
filesystems.c
fs-writeback.c
generic_acl.c
inode.c
inotify.c
inotify_user.c
internal.h
ioctl.c
ioprio.c
libfs.c
locks.c
mbcache.c
mpage.c
namei.c
namespace.c
nfsctl.c
no-block.c
open.c
pipe.c
pnode.c
pnode.h
posix_acl.c
quota.c
quota_v1.c
quota_v2.c
read_write.c
read_write.h
readdir.c
select.c
seq_file.c
signalfd.c
splice.c
stack.c
stat.c
super.c
sync.c
timerfd.c
utimes.c
xattr.c
xattr_acl.c