Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3494135pxv; Mon, 26 Jul 2021 05:33:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy8mSbhTGMGejZwnIu6EtII/wGmLk2jJOrbePKMqrtzKbKr3xYTdV+c05cTnAHRYuCLg1pj X-Received: by 2002:a92:cf03:: with SMTP id c3mr13062185ilo.195.1627302803007; Mon, 26 Jul 2021 05:33:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627302803; cv=none; d=google.com; s=arc-20160816; b=msMTd0turn95rcxuYBoS/elQQ0rxebgxno7ejimLav2fEzSkI4JUmZFLdhj8Nu5FYU YXP1UNkbO+q4HezOWuprHbN2YKPx+znhZ9d8H2jAdtJ7K6ggyB289aB+L5dkPacqSGE6 8EwUBSmqQhhU4+sPT7EFo+RMkIjAVZlT/J2D3RY06C1P4nenbSaWSpzqQZQov5TRekDV Z17QunXCPkBR2DhU09U5akqRHuZCP0ocDEsL7Dv4IlJ4USzeXaFAvZ9Icgs+ALJe69lj NYPP5spi9KsvfVuafceott5lzX1hFfISwla7hAnE93TbUQctTqSzXyeQiNuq0TsZ9+NF jBQg== 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:organization :from:references:cc:to:subject:reply-to; bh=67DPmuVGmIFuqyIflm6zRs2pQu8T3lXojsTO5lGx3ks=; b=u/y8p9fu9fD+jWZn0E/tyRUkvndF175vLtqUJMkN/pHt3VlT5q7nubspw3mStNT8of 0ywJR0z6Z2PhHDAa86Ngw6TyIeZtRQFNndqp25HGb9d0rbMLkhzqWJlcwrv/hCh9X/mu uknLl8DDk1RxyvdYq2YnpXZXZN1IV5jmUf7/9UpTEgC3W1i8z8F5gGc/pc/PtY6Ngxa5 Uv3a4cQ/1Sik/hHWvF10T/P8SHT/FZbdqpPRd4yoCpwHc60q0R76P/bjtL8UDlHqPK1U bbVDaW78A7bXKMD4RMGJUqT3MDYnBs3UMj3cwtx8gjbJSKI6ZQYQo9FmjFIpYSI2JxO0 jOnQ== 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 c7si17818661iot.72.2021.07.26.05.33.11; Mon, 26 Jul 2021 05:33:22 -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 S234179AbhGZLvY (ORCPT + 99 others); Mon, 26 Jul 2021 07:51:24 -0400 Received: from smtp99.ord1c.emailsrvr.com ([108.166.43.99]:46334 "EHLO smtp99.ord1c.emailsrvr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234161AbhGZLvP (ORCPT ); Mon, 26 Jul 2021 07:51:15 -0400 X-Greylist: delayed 473 seconds by postgrey-1.27 at vger.kernel.org; Mon, 26 Jul 2021 07:51:13 EDT X-Auth-ID: markh@compro.net Received: by smtp13.relay.ord1c.emailsrvr.com (Authenticated sender: markh-AT-compro.net) with ESMTPSA id C6730A0115; Mon, 26 Jul 2021 08:23:48 -0400 (EDT) Reply-To: markh@compro.net Subject: Re: [BUG] FLOPPY DRIVER since 5.10.20 To: Denis Efremov , dmarkh@cfl.rr.com, linux-block@vger.kernel.org, Linux-kernel Cc: Jiri Kosina , Greg Kroah-Hartman References: From: Mark Hounschell Organization: Compro Computer Svcs. Message-ID: <1cf8e751-db77-441e-53b4-d6e979bbe046@compro.net> Date: Mon, 26 Jul 2021 08:23:48 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Classification-ID: 0104ae61-b9b1-446d-a266-59dbbb31ebfc-1-1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/26/21 7:37 AM, Denis Efremov wrote: > > > On 7/26/21 2:17 PM, Mark Hounschell wrote: >> On 7/26/21 3:57 AM, Denis Efremov wrote: >>> Hi, >>> >>> On 7/23/21 9:47 PM, Mark Hounschell wrote: >>>> >>>> These 2 incremental patches, patch-5.10.19-20 and patch-5.11.2-3 have broken the user land fd = open("/dev/fd0", (O_RDWR | O_NDELAY)); functionality. >>> >>> Thank you for the report, I'm looking into this. >>> >>>> Since FOREVER before the patch, when using O_NDELAY, one could open the floppy device with no media inserted or even with write protected media without error. "Read-only file system" status is returned only when we actually tried to write to it. We have software still in use today that relies on this functionality. >>> >>> If it's a project with open sources could you please give a link? >>> >>> Regards, >>> Denis >>> >> This is immaterial but fdutils and libdsk both use rely on this flag. Who can know who else does. The point is it should NOT have been changed. > > Yes, I asked this only to add utils and this behavior to the tests. > And be more specific about why we should preserve this behavior in > next commit messages. > Well, first thing is now you can't open a floppy with a write protected floppy installed. I don't think that was intended but that is now how it is. Next there are commands that can be sent to the floppy via "ioctl(fd, FDRAWCMD, &raw_cmd);" that do NOT require a floppy diskette to be installed. All commands issued to the device that require a floppy diskette without a diskette installed fail with the proper status letting you know the device is not ready / no diskette installed. That goes for write protected floppies too. There is no reason to force a user to only be able to operate on Linux fdformat formatted floppies. Regards Mark