Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1167862pxk; Fri, 4 Sep 2020 02:24:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw61At9uuCBt3Y5g/4UxDZY075nTllHi5aVG/jMiMoe+cC8fO3H6jBefb7d/FVCjWtPvTQU X-Received: by 2002:a17:906:2e83:: with SMTP id o3mr6751899eji.47.1599211447184; Fri, 04 Sep 2020 02:24:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599211447; cv=none; d=google.com; s=arc-20160816; b=QDMuDXF7SYDlXsrvvlrGSWLVryd6JymSYOr96YZ7zX1ISs6/7qsH5VAZeDEi8VJF/+ 193ABoVI9XZWfp+tGZtM9nJmVOeRILBOlxHkZBTT7N5ZYwZ+f7E056pGCG2LH9V4gVwV Qtth8cXEYjSDKtxafuByH+uCX1tScLy5ozRrgvwvEswFjETR/+ICXAv9/+IKLns0vgjw swaMWG0UCKgPJZnsqna8SwP1JcJfyrnpExqftovYUcQBgWlYKR7tsgYEhHkwmc0fEVg8 hMoBSLMS9+2ZzSTaPjKqHcq55Jbv/2pe8Z4cz/YuOboP/7Q5mAmGV2KQhIalMOS1lI9C RWDQ== 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; bh=4ItOXMRQLggaDpGAbc6Yo9CB1poujt/uf0Zk2Oa5YR8=; b=kudTw4FoHuNHKZnc4r4oJqRMsN/qq5a/Iakr8UExeBrZnq2uL6OrzaCbD/BCrj2WEk 6NFFUxERqWoHRjRwWg3M6AdOyvKYSW2iMuKzBical8wHtzmf2ib93fqTTN35WwKxm5A8 SPIDUEtOEQFkFKTjOx/d2R65/Oh39zurb0yN1KYv85HhetDXYxLn2609AAJOMru8/F6x 4rZPS5mgtrX4Wr7yXWaVP1GL4S2cgFgkuh9FPry40carqn6dltimT3EOru7hmlPDCD9k cKMtj9EpWB1et2AQ9XP/Q/fQ3sDVAmIN3jQwCgBIX+KuuBA5kgTrnETLIFoePOvnr520 uLLw== 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 u17si3316924edx.501.2020.09.04.02.23.44; Fri, 04 Sep 2020 02:24:07 -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 S1730042AbgIDJXK (ORCPT + 99 others); Fri, 4 Sep 2020 05:23:10 -0400 Received: from mx2.suse.de ([195.135.220.15]:39698 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728588AbgIDJXK (ORCPT ); Fri, 4 Sep 2020 05:23:10 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 899CAB165; Fri, 4 Sep 2020 09:23:08 +0000 (UTC) Subject: Re: rework check_disk_change() To: dgilbert@interlog.com, 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> <730eced4-c804-a78f-3d52-2a448dbd1b84@interlog.com> From: Hannes Reinecke Message-ID: <29ec4708-3a8d-a4f2-5eea-a08908a8d093@suse.de> Date: Fri, 4 Sep 2020 11:23:04 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <730eced4-c804-a78f-3d52-2a448dbd1b84@interlog.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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@suse.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