Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp557465pxk; Wed, 2 Sep 2020 08:42:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJydNsBlg+NLZzkKqRht65yUjhp4ZpHkk58XVwkaRLLi8YS7GoGvVZy1h38+JQZ1ygi7MBJ2 X-Received: by 2002:aa7:dbd9:: with SMTP id v25mr732527edt.78.1599061356014; Wed, 02 Sep 2020 08:42:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599061356; cv=none; d=google.com; s=arc-20160816; b=POGkKnbkbxrKOAc8GHgUQjg7AfoCeUgbMA+19PJwUZUYkb7yTSL+lQIYOwHf6d4xkj xdDBwRlPuMZwr5P61McmqjP/slWsKjIR8zZA6d01jTM2Ce564R4E67pwgr8/eHHwoiw3 053b7QMdp4gCN3sF1GrO+KTzJC5VKjfVEwcVQx7LKtATN/YepmjMY+i11i/hdJf/r8Fl 6uh0PYe7QQw+6U5wGBJEDN5zfX+xBO3m9KM1veKhrCEvsxfr+MQgL+QWO+mHxQ5ei5Or fWLgHUqiaZnM3HUD3G8y6i8ZHv7tyavtuyTznqSO82KM2BveHtpTkHjgGEySi/ElgCWP XbvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:reply-to; bh=89AJH0lZRL2Kk13Xod0yH8wBYyf8qJVpG/n2PUZS3fI=; b=o5uYof7yhC7JXaRfoir2HHfEICElXUhsggAXIoOqJmQlfkqTqyAg1sr0ZO6M/LoL9K lYZmrXbYimc4GENzk0F6OIUK53Bpq7AGHj9h8C44e7kCFzIRARI4a9ZgyBudQYN9Jz8U BXrEtIXVgqaBEfksQviAI8a7g2w7G+kVmzmejot0NqPZoMnp8+cApTUUbGkxlIbnd3nI +G52WO30iFQmSEJMNs2GJB2ZQ6lEgbb2IGGTcJNNW1Uh6KQI8Kpi7OgCOGyCiyQWhSX/ B9l2Q3K1HV5UR21twpKDDyKjJtPxE0yrmPyi9GkIwDIkx9Ig6+e+piHSl5yXQKOoijYI itgg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id mh2si2684444ejb.228.2020.09.02.08.41.51; Wed, 02 Sep 2020 08:42:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728148AbgIBPjC (ORCPT + 99 others); Wed, 2 Sep 2020 11:39:02 -0400 Received: from smtp.infotech.no ([82.134.31.41]:51366 "EHLO smtp.infotech.no" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727895AbgIBPi6 (ORCPT ); Wed, 2 Sep 2020 11:38:58 -0400 Received: from localhost (localhost [127.0.0.1]) by smtp.infotech.no (Postfix) with ESMTP id 93E6A20418E; Wed, 2 Sep 2020 17:38:52 +0200 (CEST) X-Virus-Scanned: by amavisd-new-2.6.6 (20110518) (Debian) at infotech.no Received: from smtp.infotech.no ([127.0.0.1]) by localhost (smtp.infotech.no [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PCCwPRfO6cmJ; Wed, 2 Sep 2020 17:38:50 +0200 (CEST) Received: from [192.168.48.23] (host-45-78-251-166.dyn.295.ca [45.78.251.166]) by smtp.infotech.no (Postfix) with ESMTPA id 04A34204158; Wed, 2 Sep 2020 17:38:47 +0200 (CEST) Reply-To: dgilbert@interlog.com Subject: Re: rework check_disk_change() To: Christoph Hellwig , Jens Axboe Cc: Denis Efremov , Tim Waugh , Michal Simek , Borislav Petkov , "David S. Miller" , Song Liu , "Martin K. Petersen" , Finn Thain , Michael Schmitz , linux-m68k@lists.linux-m68k.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-ide@vger.kernel.org, linux-raid@vger.kernel.org, linux-scsi@vger.kernel.org, linux-fsdevel@vger.kernel.org References: <20200902141218.212614-1-hch@lst.de> From: Douglas Gilbert Message-ID: <730eced4-c804-a78f-3d52-2a448dbd1b84@interlog.com> Date: Wed, 2 Sep 2020 11:38:45 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20200902141218.212614-1-hch@lst.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-CA Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? Doug Gilbert