Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1201401pxk; Fri, 4 Sep 2020 03:30:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxqYJR+HRyHtYiHYyrICHKy86X+5VIzb+ZOwBtwKF5YLK6BWP8QZihrbJ2cvDpm5ikBEz8c X-Received: by 2002:a17:906:b24e:: with SMTP id ce14mr6451889ejb.494.1599215423583; Fri, 04 Sep 2020 03:30:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599215423; cv=none; d=google.com; s=arc-20160816; b=o95JIy+FzdqvpuJWrae6CHGv4z/Cto8fnTKoRgJjy/Ky1u99dFNjmV+7H1FSM+74NA 2wzmBaVLx6CtSrwbVw2UDe3HEhbkaZxqyoPkQhBLsBnNLGiSaswmEqqSFSzzSko/ZuHn 1XYRoVXsP8t8tw/HS6zU0eErzmX19VTs4OY+lFyo5VylIPT0IVjdAEDWSGuROw2oDKDE NwshG7y0srtm3DuZ7rTkMgUNoUESP59S6zRA5pvrZdyv6Vkua+cVu4bye2gCZezspAdv XW686nSkE2gpW66ZEHg47FOVdK9u2/hU0QWp7pg63flaGE07n6nw6WjEAkiQityy0xfk ctRg== 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=GB6qTBkQBUwtxRrUStmDoysY3s/1adtoca8oD2pULZ8=; b=dCLNTwx+bHMnpQWjfzCqjJtH02KzdhV/Ax3efJCodL7iYLNQROTjqSeJ7MutYRhVCM TAu039KpROcC55BhUxqzVWG/+P+uiPOEEjcH0XnGoMnIrr+NHp1ccEBKs82WXmqFrlN+ aZY82kVyV7F4rk5j0A2hOrBiOQ6zbXvv4Zy7sWjQFLjtIBdGVHIxHYLyskNAdJha/xDi VSlO+fynLsy8R6I7IGTQFa1yNK7uF4eyFOrKKK9da0XH+H6Cvhndi1AVtiKXzsKqda6g Oh6SNmBzBjl4XT8sTvkO4qNHo1Z38k4ybNNnH2lYLa6ouPA3NDYIfS0IVSZ9UHFEitTD oPhw== 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 l14si3925930edv.544.2020.09.04.03.30.00; Fri, 04 Sep 2020 03:30:23 -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 S1730140AbgIDK3R (ORCPT + 99 others); Fri, 4 Sep 2020 06:29:17 -0400 Received: from mx2.suse.de ([195.135.220.15]:47196 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730114AbgIDK3H (ORCPT ); Fri, 4 Sep 2020 06:29:07 -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 16A6DB7FC; Fri, 4 Sep 2020 10:29:07 +0000 (UTC) Subject: Re: [PATCH 16/19] ataflop: use a separate gendisk for each media format To: Christoph Hellwig , Jens Axboe Cc: Greg Kroah-Hartman , "Rafael J. Wysocki" , Denis Efremov , "David S. Miller" , Song Liu , Al Viro , Finn Thain , Michael Schmitz , 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-m68k@lists.linux-m68k.org References: <20200903080119.441674-1-hch@lst.de> <20200903080119.441674-17-hch@lst.de> From: Hannes Reinecke Message-ID: Date: Fri, 4 Sep 2020 12:29:05 +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: <20200903080119.441674-17-hch@lst.de> 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/3/20 10:01 AM, Christoph Hellwig wrote: > The Atari floppy driver usually autodetects the media when used with the > ormal /dev/fd? devices, which also are the only nodes created by udev. > But it also supports various aliases that force a given media format. > That is currently supported using the blk_register_region framework > which finds the floppy gendisk even for a 'mismatched' dev_t. The > problem with this (besides the code complexity) is that it creates > multiple struct block_device instances for the whole device of a > single gendisk, which can lead to interesting issues in code not > aware of that fact. > > To fix this just create a separate gendisk for each of the aliases > if they are accessed. > > Signed-off-by: Christoph Hellwig > --- > drivers/block/ataflop.c | 135 +++++++++++++++++++++++++--------------- > 1 file changed, 86 insertions(+), 49 deletions(-) > Reviewed-by: Hannes Reinecke 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