Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp3455185ybz; Mon, 4 May 2020 03:22:12 -0700 (PDT) X-Google-Smtp-Source: APiQypI6W/crHL+r3qEQ7SRvJxKNouwjtxvca2iUl6k/QLmNY0qnjPR6ZCUbBu3p1UF/P+GNxYkD X-Received: by 2002:a17:906:310e:: with SMTP id 14mr14583269ejx.177.1588587732419; Mon, 04 May 2020 03:22:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588587732; cv=none; d=google.com; s=arc-20160816; b=PvjFLy7UAw1eyjYgdAUIYrhztOL9/xd0BANRifeHAhAO9N1s65NBlOAsMvz6dL9pB4 53fSzBGcHnzGfwZ2lOYk2/jrhs7imREwm+Y1GvrgFZMctM3qG/ISy+LiZpTEbFuo0PhJ sj6XYWTc2vWMsm2Bx+jrwAQt1SA2pwHJV/uswCNAN/0XKg9qWGIV57EAtnIrRrInFo9j on5U+WEwD97p2JxxTLA1PfoX+Ul46mdv6tzWBoQFzvLBxjDFOFVNv2ouHvdbe82VoSV9 6CRgFtM9Gd3ePngLzSB+xgA8++lSohcSmjOFhhVRsKi13NUhf3t9Y5XujRTaqlvWn+fG IBAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:subject:autocrypt:references:cc:to:from; bh=ZgWJrSJCXxkEADWQdgF0CKwDPPipf+/H/z+dvRwFB4w=; b=PcHoJ2iSA1CM1aECDweR2N+HrLOQjzftjYipAJfpbENOP9C7mOkt/nYh61P5d6+Xdg VhsRb9WZ6LnZ0uXcfd3oyhwqcHHW+OJdhMdbdsMWQZkrE417YXtCKcLhPmZFs4xGAP91 JMrZv611yZtEY1iGQpni3WHxXEYooIVo9yaymsQqAnNhRRZxwN1GVjrk28gxJ4nFglQg n2AvMU9/uFH4k83KlLU5oP5z+yRV4cXjfJhENK2zOwtl1AEqAKNiYrR1S/JJXIli7J1L dAIoxroESnJWoknl5L/B9NBN07m9eQH9eevOgoqS82DtaDiMtDXXsyEUg9dd6ygHKKNg 9pVQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c23si6466182edy.407.2020.05.04.03.21.47; Mon, 04 May 2020 03:22:12 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728299AbgEDIpp convert rfc822-to-8bit (ORCPT + 99 others); Mon, 4 May 2020 04:45:45 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:26900 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726351AbgEDIpo (ORCPT ); Mon, 4 May 2020 04:45:44 -0400 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0448WGAk068567; Mon, 4 May 2020 04:45:40 -0400 Received: from ppma04ams.nl.ibm.com (63.31.33a9.ip4.static.sl-reverse.com [169.51.49.99]) by mx0a-001b2d01.pphosted.com with ESMTP id 30s4xjgttf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 04 May 2020 04:45:39 -0400 Received: from pps.filterd (ppma04ams.nl.ibm.com [127.0.0.1]) by ppma04ams.nl.ibm.com (8.16.0.27/8.16.0.27) with SMTP id 0448eU7a022879; Mon, 4 May 2020 08:45:37 GMT Received: from b06avi18878370.portsmouth.uk.ibm.com (b06avi18878370.portsmouth.uk.ibm.com [9.149.26.194]) by ppma04ams.nl.ibm.com with ESMTP id 30s0g5mbk3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 04 May 2020 08:45:37 +0000 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06avi18878370.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 0448jYUp59441472 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 4 May 2020 08:45:34 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9F7F111C058; Mon, 4 May 2020 08:45:34 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 347F111C04C; Mon, 4 May 2020 08:45:34 +0000 (GMT) Received: from linux.fritz.box (unknown [9.145.145.121]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Mon, 4 May 2020 08:45:34 +0000 (GMT) From: Stefan Haberland To: Christoph Hellwig Cc: axboe@kernel.dk, linux-block@vger.kernel.org, hoeppner@linux.ibm.com, linux-s390@vger.kernel.org, heiko.carstens@de.ibm.com, gor@linux.ibm.com, borntraeger@de.ibm.com, linux-kernel@vger.kernel.org, Peter Oberparleiter References: <20200430111754.98508-1-sth@linux.ibm.com> <20200430111754.98508-2-sth@linux.ibm.com> <20200430131351.GA24813@lst.de> <4ab11558-9f2b-02ee-d191-c9a5cc38de0f@linux.ibm.com> Autocrypt: addr=sth@linux.ibm.com; keydata= mQINBFtGVggBEADI1Lne1npTa+b5x5EJ7ka0siRM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3mn6O084g01w6Y/rdWFVSWDh9oaQNmR7aeB8JDOklOPJCe0bBKFK0ZMF1Kz9AzFj/RFzWfB5 ABEBAAGJAiUEGAEIAA8FAltGVggCGwwFCQlmAYAACgkQ9KmDAON4ldGPmA/+L3V5wkmWZJjD ZJIvio/wHMoqObEG6MxsFvGEoSDJBBGQ5oTiysACFM2vkOaOhj2Izh2L+dbuKJIT0Qus0hUJ uEjGgIAXn7hYNeM1MMqSA81NEoCeUhNHeZudf5WSoglG3rUnxIXrnxfDkn8Vd36cinGejyrI qJoydRMpX48I3wJcyvZ8+xgM/LLlvXEH4BpuJL+vQkefJrn0R2vxTnHcj5TE1tKNwhI7/343 PNzhgHGYynjCbF4u9qpSqcJl/exFnRXaTH6POIbHXIRe8n4TfdXsOcbI3j/GUF0cXinkfxdt BWH5rC3Ng+EN3jkDo8N9qF7uEqN9rRaekqsO0jYMQJlfZeJSQH9KHD+wgZly9j6DmnGexbdB aJdzCtbIR+oJy0HjfwvIQrgp1pj0yvXeDsUHykATsORx0ZitlGUuU6tlAnbH346nNSDoklLI lEDvODTgpkhWDczM69MGKrFYgDcIqXZFWzea6Xq+cuGtGO5xV/4K+efWQovlIdv4mE4j2E2G yXj14Nuyh4wqdX9/yspSZCH1TCbXD9WEB5nQCQNAKzIB7YaTQBjFi1HFzGOGYteZGC37DJ6a xEMRG8/iNZSU4dSL+XsaTnUk5wzzSnz0QVOEOqRY5tkS3zpo9OUGevyR3R6bRqH3EaA5H1cS cH4TNHyhiR0KAbxE8qKx3Jc= Subject: Re: [PATCH 1/1] s390/dasd: remove ioctl_by_bdev from DASD driver Message-ID: <70f541fe-a678-8952-0753-32707d21e337@linux.ibm.com> Date: Mon, 4 May 2020 10:45:33 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <4ab11558-9f2b-02ee-d191-c9a5cc38de0f@linux.ibm.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT Content-Language: en-US X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138,18.0.676 definitions=2020-05-04_04:2020-05-01,2020-05-04 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 mlxlogscore=933 spamscore=0 impostorscore=0 mlxscore=0 adultscore=0 suspectscore=0 clxscore=1015 priorityscore=1501 bulkscore=0 phishscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2005040069 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am 30.04.20 um 16:02 schrieb Stefan Haberland: > Am 30.04.20 um 15:13 schrieb Christoph Hellwig: >> On Thu, Apr 30, 2020 at 01:17:54PM +0200, Stefan Haberland wrote: >>> Remove the calls to ioctl_by_bdev from the DASD partition detection code >>> to enable the removal of the specific code. >>> >>> To do so reuse the gendisk private_data pointer and not only provide a >>> pointer to the devmap but provide a new structure containing a pointer >>> to the devmap as well as all required information for the partition >>> detection. This makes it independent from the dasd_information2_t >>> structure. >> I think sharing the data structure in private data is pretty dangerous. > Thought of this as well. This is why I check for the major number before I > use the private pointer to reference the data structure. Thought this would > be enough checking. > Do you think this is not sufficient? > >> In the meantime I thought of another idea - the partition code could >> do a symbol_get of a symbol exported by the dasd driver and use that >> to query the information. > Then I would need to export a lot of DASD internal structures to be > available > in thepartition detection code if I would like to walk down our device > map to > findthe corresponding device for example. Not sure if this is that easy. I did some additional research on this. What I could imagine: The gendisk->private_data pointer currently contains a pointer to the dasd_devmap structure. This one is also reachable by iterating over an exported dasd_hashlist. So I could export the dasd_hashlist symbol, iterate over it and try to find the dasd_devmap pointer I have from the gendisk->private_data pointer. This would ensure that the gendisk belongs to the DASD driver and I could use the additional information that is somehow reachable through the gendisk->private_data pointer. But again, I am not sure if this additional code and effort is needed. From my point of view checking the gendisk->major for DASD_MAJOR is OK to ensure that the device belongs to the DASD driver. What do you think?