Sophie

Sophie

distrib > Mageia > 8 > i586 > by-pkgid > f65f1d773383ac49d6fcc3657259ff43 > files > 179

kernel-5.10.45-2.mga8.src.rpm

From c95920229c50b216fafcbdba8713b653cda1a223 Mon Sep 17 00:00:00 2001
From: Thomas Backlund <tmb@mageia.org>
Date: Tue, 5 Jan 2021 18:05:15 +0200
Subject: [PATCH] Revert "sd: use bdev_check_media_change"

This reverts commit 471bd0af544bcd80450d61659a1ffabdd1820d7d.

https://bugs.mageia.org/show_bug.cgi?id=27877
https://bugzilla.kernel.org/show_bug.cgi?id=211023

Signed-off-by: Thomas Backlund <tmb@mageia.org>
---
 drivers/scsi/sd.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 656bcf4940d6..6cdb1d773725 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -1423,10 +1423,8 @@ static int sd_open(struct block_device *bdev, fmode_t mode)
 	if (!scsi_block_when_processing_errors(sdev))
 		goto error_out;
 
-	if (sdev->removable || sdkp->write_prot) {
-		if (bdev_check_media_change(bdev))
-			sd_revalidate_disk(bdev->bd_disk);
-	}
+	if (sdev->removable || sdkp->write_prot)
+		check_disk_change(bdev);
 
 	/*
 	 * If the drive is empty, just let the open fail.
@@ -1888,6 +1886,7 @@ static const struct block_device_operations sd_fops = {
 	.compat_ioctl		= sd_compat_ioctl,
 #endif
 	.check_events		= sd_check_events,
+	.revalidate_disk	= sd_revalidate_disk,
 	.unlock_native_capacity	= sd_unlock_native_capacity,
 	.report_zones		= sd_zbc_report_zones,
 	.pr_ops			= &sd_pr_ops,
-- 
2.30.0