Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
block: rescan partitions on invalidated devices on -ENOMEDIA too
__blkdev_get() doesn't rescan partitions if disk->fops->open() fails, which leads to ghost partition devices lingering after medimum removal is known to both the kernel and userland. The behavior also creates a subtle inconsistency where O_NONBLOCK open, which doesn't fail even if there's no medium, clears the ghots partitions, which is exploited to work around the problem from userland. Fix it by updating __blkdev_get() to issue partition rescan after -ENOMEDIA too. This was reported in the following bz. https://bugzilla.kernel.org/show_bug.cgi?id=13029 Note for stable: 2.6.38 and later only Cc: [email protected] Signed-off-by: Tejun Heo <[email protected]> Reported-by: David Zeuthen <[email protected]> Reported-by: Martin Pitt <[email protected]> Reported-by: Kay Sievers <[email protected]> Tested-by: Kay Sievers <[email protected]> Cc: Alan Cox <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
- Loading branch information