[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1b972d93-e8e3-8f32-86de-76792948e20b@gmail.com>
Date: Wed, 2 Sep 2020 19:19:17 +0300
From: Sergei Shtylyov <sergei.shtylyov@...il.com>
To: Christoph Hellwig <hch@....de>, Jens Axboe <axboe@...nel.dk>
Cc: Denis Efremov <efremov@...ux.com>, Tim Waugh <tim@...erelk.net>,
Michal Simek <michal.simek@...inx.com>,
Borislav Petkov <bp@...en8.de>,
"David S. Miller" <davem@...emloft.net>,
Song Liu <song@...nel.org>,
"Martin K. Petersen" <martin.petersen@...cle.com>,
Finn Thain <fthain@...egraphics.com.au>,
Michael Schmitz <schmitzmic@...il.com>,
linux-m68k@...ts.linux-m68k.org, linux-block@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-ide@...r.kernel.org,
linux-raid@...r.kernel.org, linux-scsi@...r.kernel.org,
linux-fsdevel@...r.kernel.org
Subject: Re: [PATCH 16/19] sd: use bdev_check_media_change
On 9/2/20 5:12 PM, Christoph Hellwig wrote:
> Switch to use bdev_check_media_change instead of check_disk_change and
> call cd_revalidate_disk manually. As sd also calls sd_revalidate_disk
s/cd/sd/?
> manually during probe and open, , the extra call into ->revalidate_disk
> from bdev_disk_changed is not required either, so stop wiring up the
> method.
>
> Signed-off-by: Christoph Hellwig <hch@....de>
> ---
> drivers/scsi/sd.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
> index 2bec8cd526164d..d020639c28c6ca 100644
> --- a/drivers/scsi/sd.c
> +++ b/drivers/scsi/sd.c
> @@ -1381,8 +1381,10 @@ 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)
> - check_disk_change(bdev);
> + if (sdev->removable || sdkp->write_prot) {
> + if (bdev_check_media_change(bdev))
> + sd_revalidate_disk(bdev->bd_disk);
> + }
>
> /*
> * If the drive is empty, just let the open fail.
[...]
MBR, Sergei
Powered by blists - more mailing lists