lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 4 Sep 2020 11:23:04 +0200
From:   Hannes Reinecke <hare@...e.de>
To:     dgilbert@...erlog.com, 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: rework check_disk_change()

On 9/2/20 5:38 PM, Douglas Gilbert wrote:
> On 2020-09-02 10:11 a.m., Christoph Hellwig wrote:
>> Hi Jens,
>>
>> this series replaced the not very nice check_disk_change() function with
>> a new bdev_media_changed that avoids having the ->revalidate_disk call
>> at its end.  As a result ->revalidate_disk can be removed from a lot of
>> drivers.
>>
> 
> For over 20 years the sg driver has been carrying this snippet that hangs
> off the completion callback:
> 
>         if (driver_stat & DRIVER_SENSE) {
>                  struct scsi_sense_hdr ssh;
> 
>                  if (scsi_normalize_sense(sbp, sense_len, &ssh)) {
>                          if (!scsi_sense_is_deferred(&ssh)) {
>                                  if (ssh.sense_key == UNIT_ATTENTION) {
>                                          if (sdp->device->removable)
>                                                  sdp->device->changed = 1;
>                                  }
>                          }
>                  }
>          }
> 
> Is it needed? The unit attention (UA) may not be associated with the
> device changing. Shouldn't the SCSI mid-level monitor UAs if they
> impact the state of a scsi_device object?
> 
We do; check scsi_io_completion_action() in drivers/scsi/scsi_lib.c
So I don't think you'd need to keep it in sg.c.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke                Kernel Storage Architect
hare@...e.de                              +49 911 74053 688
SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), Geschäftsführer: Felix Imendörffer

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ