Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp967562pxu; Wed, 7 Oct 2020 22:58:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxomLaI/e7UrZl3Jf7O3OokFhjxduRlk6HKZkYdmyQhcB2xgeb6nH7Iv44TSB5K1YJcnUke X-Received: by 2002:a17:906:4d10:: with SMTP id r16mr7462715eju.68.1602136704807; Wed, 07 Oct 2020 22:58:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602136704; cv=none; d=google.com; s=arc-20160816; b=aYSCL1wD95e8gYawkWKBhiOh+nrcWDF3FmtglHDbNlyjTIh4W/knQxEtnNS2cDmZ7w sy7CQc0Wx6k5QH/E21QWvn4cnevRlxryCA4xqYuNSzAy2n5fZ347+H4imVrqbi4khHMl aKY/ZOXFSPFl9IEQL6Q+PWccbiDnHMVL2x0X74wd2xKRLn/xihCqOQ2I56q/rnmiZwj/ cvL4hFaOwNNciQKjl9R9rvMpzp9cew8ReVHQsgju27zPnt5GDEU2tL7+67S6W8zrE6MQ 6xmcmaI8+Q8E7tc9cgMFps/WjzJemLU1tQ5sEMcZZrt0FdQEHkgpUlGkKFfz0WIUWjwE MmXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=LI8ctmdVg7gsQB0mlRsRDcg+g3/Pb2sJNlDzFIc5gdo=; b=MX8wM0GOd1qpnlayPFY+I+38wIG37VSDjGxqjod9tRJ4RtD0PdUE9U8O3hm4m25EgZ s149j6WUH8jgez21EaXgZ7hYQyfQoU/u20aKGl8pIKWxn05vQtcm6O65EuUaoagiaxGo Ux6WsUU+xcd8zgJfSYBsLK11WbyqaClREbNnS/BSyBQPUFlY8hACU5TP11Ioqc1uw/40 +p81IIvZzHNzRFyU8ED1rohmP/y6ri30RzrW2fGNpVs5gnTh1FLzkeRUOv3x49/t9MsW hexjtYzJzNpA5Czx76e4pIeuPqsQ9yWJvy1Yv4bHB7LybSWOcOLSFZG5yUnZFWDM7+kL 5wSw== 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 cx23si2894938edb.541.2020.10.07.22.58.01; Wed, 07 Oct 2020 22:58:24 -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 S1728466AbgJHFzE (ORCPT + 99 others); Thu, 8 Oct 2020 01:55:04 -0400 Received: from mx2.suse.de ([195.135.220.15]:37198 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728312AbgJHFzD (ORCPT ); Thu, 8 Oct 2020 01:55:03 -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 1BA43B00A; Thu, 8 Oct 2020 05:55:02 +0000 (UTC) Subject: Re: [v5 01/12] struct device: Add function callback durable_name To: tasleson@redhat.com, Greg Kroah-Hartman Cc: Christoph Hellwig , linux-scsi@vger.kernel.org, linux-block@vger.kernel.org, linux-ide@vger.kernel.org, pmladek@suse.com, David Lehman , sergey.senozhatsky@gmail.com, jbaron@akamai.com, James.Bottomley@HansenPartnership.com, linux-kernel@vger.kernel.org, rafael@kernel.org, martin.petersen@oracle.com, kbusch@kernel.org, axboe@fb.com, sagi@grimberg.me, akpm@linux-foundation.org, orson.zhai@unisoc.com, viro@zeniv.linux.org.uk References: <20200925161929.1136806-1-tasleson@redhat.com> <20200925161929.1136806-2-tasleson@redhat.com> <20200929175102.GA1613@infradead.org> <20200929180415.GA1400445@kroah.com> <20e220a6-4bde-2331-6e5e-24de39f9aa3b@redhat.com> <20200930073859.GA1509708@kroah.com> <20201001114832.GC2368232@kroah.com> <72be0597-a3e2-bf7b-90b2-799d10fdf56c@redhat.com> From: Hannes Reinecke Message-ID: Date: Thu, 8 Oct 2020 07:54:59 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <72be0597-a3e2-bf7b-90b2-799d10fdf56c@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/7/20 10:10 PM, Tony Asleson wrote: > On 10/1/20 6:48 AM, Greg Kroah-Hartman wrote: >> On Wed, Sep 30, 2020 at 09:35:52AM -0500, Tony Asleson wrote: >>> On 9/30/20 2:38 AM, Greg Kroah-Hartman wrote: >>>> On Tue, Sep 29, 2020 at 05:04:32PM -0500, Tony Asleson wrote: >>>>> I'm trying to figure out a way to positively identify which storage >>>>> device an error belongs to over time. >>>> >>>> "over time" is not the kernel's responsibility. >>>> >>>> This comes up every 5 years or so. The kernel provides you, at runtime, >>>> a mapping between a hardware device and a "logical" device. It can >>>> provide information to userspace about this mapping, but once that >>>> device goes away, the kernel is free to reuse that logical device again. >>>> >>>> If you want to track what logical devices match up to what physical >>>> device, then do it in userspace, by parsing the log files. >>> >>> I don't understand why people think it's acceptable to ask user space to >>> parse text that is subject to change. >> >> What text is changing? The format of of the prefix of dev_*() is well >> known and has been stable for 15+ years now, right? What is difficult >> in parsing it? > > Many of the storage layer messages are using printk, not dev_printk. > So that would be the immediate angle of attack ... >>>>> Thank you for supplying some feedback and asking questions. I've been >>>>> asking for suggestions and would very much like to have a discussion on >>>>> how this issue is best solved. I'm not attached to what I've provided. >>>>> I'm just trying to get towards a solution. >>>> >>>> Again, solve this in userspace, you have the information there at >>>> runtime, why not use it? >>> >>> We usually don't have the needed information if you remove the >>> expectation that user space should parse the human readable portion of >>> the error message. >> >> I don't expect that userspace should have to parse any human readable >> portion, if they don't want to. But if you do want it to, it is pretty >> trivial to parse what you have today: >> >> scsi 2:0:0:0: Direct-Access Generic STORAGE DEVICE 1531 PQ: 0 ANSI: 6 >> >> If you really have a unique identifier, then great, parse it today: >> >> usb 4-1.3.1: Product: USB3.0 Card Reader >> usb 4-1.3.1: Manufacturer: Generic >> usb 4-1.3.1: SerialNumber: 000000001531 >> >> What's keeping that from working now? > > I believe these examples are using dev_printk. With dev_printk we don't > need to parse the text, we can use the meta data. > So it looks as most of your usecase would be solved by moving to dev_printk(). Why not work on that instead? I do presume this will have immediate benefits for everybody, and will have approval from everyone. 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