Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4974447ybl; Mon, 9 Dec 2019 21:08:16 -0800 (PST) X-Google-Smtp-Source: APXvYqxSSJaEImtYMYkbssL++QlYhxK+fLMxqV9V27jfZp/wpwEsLWSaDE3gc3FuQhLM9L40zSTv X-Received: by 2002:a9d:6c81:: with SMTP id c1mr23328706otr.39.1575954496314; Mon, 09 Dec 2019 21:08:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575954496; cv=none; d=google.com; s=arc-20160816; b=VVVKsIeqXZaiGX+sUGln3clMBhVE+q15IKUn7x2kYDuDejCuSJa4jf8txgmZE6ct3o qiGpPcq7efqFbMqtjArw5UIZ6IH3P2q1eDSOU+6APqJPyE/uDVRCc5tHQ6a5oQ8NdNyb DkxRy14aAlwzPqJlBX74Hl4I2zw/Dd4BZ0aC4ZJX4Zvz4FjGWBD0mMJaXkw3uWNMkH77 EcOHP6Uj/d9b5sVWa4o3zg9J9HYlz+kyQ7RW7LPNsH6AimYigB7BImKJXKy8rKUaBmAN uynr/3CtGogxabwwU2Mano8dBkxCW07UBrMIDRpOWzEplLqDO0DKM/POkOaPKmX1NQAx XrSA== 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:dkim-signature; bh=NWFQPyK+dIOMlCUbfgpUcnXmXdBuXytChyw+BNdtZU0=; b=gYnil1kpjx7pgVKSpezMQKOVSYH6JRX/cChq7fVIiyFQg42IHazn1ov2GgMKd1kwFn 9iVLm1f6C1P2xoBT9liUVX5OwtFX2NwVr1tiGgW+9fLRodfmXrwPr/YcmSpzQI2rRLfc 7HILC9iFcP1NGR0mTLp/v/gKyyUh0SNjCqZ1GkV1nJzb8LmYi1qxM9oKpbRIB0rNzD7v SMTaHcZmYIswR8CGltxVkyt4w18N3wwYzr5OWVWZGc+oCMcjsMEPiCCc/T1DVvuae//1 VnFs6FNo4lcPeQePkECymBK3lguFWmnEBAWpafZfRBiuIFUq00+mgcowaCg96QbjeLGI oxrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=TbtQEbC2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 73si1318051otj.82.2019.12.09.21.08.03; Mon, 09 Dec 2019 21:08:16 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=TbtQEbC2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726955AbfLJFHH (ORCPT + 99 others); Tue, 10 Dec 2019 00:07:07 -0500 Received: from mail-pl1-f193.google.com ([209.85.214.193]:34422 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726045AbfLJFHH (ORCPT ); Tue, 10 Dec 2019 00:07:07 -0500 Received: by mail-pl1-f193.google.com with SMTP id x17so1525380pln.1 for ; Mon, 09 Dec 2019 21:07:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=NWFQPyK+dIOMlCUbfgpUcnXmXdBuXytChyw+BNdtZU0=; b=TbtQEbC2AN7Vjifh/Yfn+zVfjCxYXqJPPRaWuRMOVgEhneVJzSbHfTvyG4A5GQK0x7 7m/OprTB9MgF89Jhrj0lQ0k/d9ufINBKCVz2w2yg1HIsTUig6MAXqSylvE4GQeKNNVP8 sSpbbURveFPtNvyBLgM85LYR6eMY+mWUhRtJwqrASR8V71hckAw8BQah/dQ4qjgVBzz8 GsudjqcLbUJF31cXnuClWs8LFncGsXFtjLrK665lIiyXL0m79jqnWsRf215kHOXMoQ8i X8y0hrIk+trGymBPeZM/MgMVJOu0KYw7zVHrTS8h0+m0wHq16rlrHmksSfGTmVWTu5XK WwhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=NWFQPyK+dIOMlCUbfgpUcnXmXdBuXytChyw+BNdtZU0=; b=Ax7zEqdWpN3p5VOAt8JUP2iYmZm6WHTrtv5SF61K6DKZYciWhQA8PiUKhOi0XAnEcw Cbt4oP7F/g0r+FFOnZB/uSYlhH18OjZAIqYIr1Zs5+H16Z8u+PSnOR3Ng65owAvOkj7L Lk42J6/QWczQGu4rs0UEbHE1am3nOUDEe0np/ysdk576JA4EjVofFZygkKYfOQNAcegk XHGisBGJNSaYOtbVGs/JG5/kPm1p1tAJg0G9dlUFxysLgqGDQft3xrLq/2+XbTn0bysK xo8iEQTYRrwcgurw7p5mhw1BRNSAoaJvYpYU7NoNkthFpYO3xgib8+JBSJNFoLvzBpIr kb2g== X-Gm-Message-State: APjAAAUYkNBpAFuH45P84ADLD4h8CoR1LGZuBdf4DGLkpX9g6N4iQVLx QbVh6fYGZE0qt2cwmBUN/qYwsnvYKBI= X-Received: by 2002:a17:90a:2223:: with SMTP id c32mr3419304pje.15.1575954426395; Mon, 09 Dec 2019 21:07:06 -0800 (PST) Received: from ?IPv6:2620:10d:c081:1133::11c7? ([2620:10d:c090:180::240]) by smtp.gmail.com with ESMTPSA id w12sm1257462pfd.58.2019.12.09.21.07.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 09 Dec 2019 21:07:05 -0800 (PST) Subject: Re: [PATCH] floppy: hide invalid floppy disk types To: =?UTF-8?Q?Moritz_M=c3=bcller?= , linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@i4.cs.fau.de Cc: "Philip K ." References: <20191208165900.25588-1-moritzm.mueller@posteo.de> From: Jens Axboe Message-ID: Date: Mon, 9 Dec 2019 22:07:03 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.1 MIME-Version: 1.0 In-Reply-To: <20191208165900.25588-1-moritzm.mueller@posteo.de> Content-Type: text/plain; charset=utf-8 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 12/8/19 9:59 AM, Moritz Müller wrote: > In some cases floppy disks are recognised even though no such device > exists. In our case this has been caused by the CMOS-RAM having a few > wrong bits. This caused a non-existent floppy disk with the type 13 > (for example) to be registered as an available device, even though it > could not be mounted by any user. > > We believe this to be an instance of this bug: > > https://bugzilla.kernel.org/show_bug.cgi?id=13486 > https://bugs.launchpad.net/ubuntu/+source/linux/+bug/384579 > > This patch adds the option FLOPPY_ALLOW_UNKNOWN_TYPES to prevent the > additional check that fixed the issue on our reference system, and > increases the startup time of affected systems by over a minute. > > Co-developed-by: Philip K. > Signed-off-by: Philip K. > Signed-off-by: Moritz Müller > --- > drivers/block/Kconfig | 10 ++++++++++ > drivers/block/floppy.c | 6 ++++++ > 2 files changed, 16 insertions(+) > > diff --git a/drivers/block/Kconfig b/drivers/block/Kconfig > index 1bb8ec575352..9e6b32c50b67 100644 > --- a/drivers/block/Kconfig > +++ b/drivers/block/Kconfig > @@ -72,6 +72,16 @@ config AMIGA_Z2RAM > To compile this driver as a module, choose M here: the > module will be called z2ram. > > +config FLOPPY_ALLOW_UNKNOWN_TYPES > + bool "Allow floppy disks of unknown type to be registered." > + default n > + help > + Select this option if you want the Kernel to register floppy > + disks of an unknown type. > + > + This should usually not be enabled, because of cases where the > + system falsely recongizes a non-existent floppy disk as mountable. > + > config CDROM > tristate > select BLK_SCSI_REQUEST > diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c > index 485865fd0412..9439444d46d0 100644 > --- a/drivers/block/floppy.c > +++ b/drivers/block/floppy.c > @@ -3949,7 +3949,9 @@ static void __init config_types(void) > } else > allowed_drive_mask &= ~(1 << drive); > } else { > +#ifdef CONFIG_FLOPPY_ALLOW_UNKNOWN_TYPES > params = &default_drive_params[0].params; > +#ifdef Please don't send patches that haven't even been compiled. -- Jens Axboe