]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
bdev: Refresh bdev size for disks without partitioning
authorJan Kara <jack@suse.cz>
Mon, 21 Oct 2019 08:38:00 +0000 (10:38 +0200)
committerKhalid Elmously <khalid.elmously@canonical.com>
Wed, 29 Jan 2020 04:47:27 +0000 (23:47 -0500)
commit87a71bb674a65dfe80e49df4ead552316901891a
tree781b6039e4cc6ba55ca5f544ba076ad51119f6e8
parent369c8c51a5d9b4c8d17f16df4d8d79398092f875
bdev: Refresh bdev size for disks without partitioning

BugLink: https://bugs.launchpad.net/bugs/1860602
commit cba22d86e0a10b7070d2e6a7379dbea51aa0883c upstream.

Currently, block device size in not updated on second and further open
for block devices where partition scan is disabled. This is particularly
annoying for example for DVD drives as that means block device size does
not get updated once the media is inserted into a drive if the device is
already open when inserting the media. This is actually always the case
for example when pktcdvd is in use.

Fix the problem by revalidating block device size on every open even for
devices with partition scan disabled.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
fs/block_dev.c