Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3900632pxb; Tue, 26 Jan 2021 07:31:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJxJQ6owJip3pMZKFAnCXTYhHh1HJoH+afBNG3mPKPcYOuMFUKUTNTnw9BQrlmMxwDmypc0s X-Received: by 2002:a05:6402:2288:: with SMTP id cw8mr4934587edb.161.1611675097291; Tue, 26 Jan 2021 07:31:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611675097; cv=none; d=google.com; s=arc-20160816; b=Qz7FCD7oQUUa5p8V9QXRV4tbylRSuTzCcrxhbFHESFUoqxjc2Uv7Qv1RPZw1TVPh3u dOVvd0GzMtdj4DHTVupZ4/t1jX8DnIuguapePRBzuOeu3O9R20KTuCK7qPsJSZSl36ia QmtzIDebrXWHSYYZDcMnCI34ecvc31ZfbMA1odIhjub4QZKVh8jLZ4qqBMmCvBjbroVP 8buxDOHZUwszrdEBi8wEhtv+mth2lMW2kNmQDwqjbmox2Ea77K0PgRJg465wLIDe1bRH w3aMwGA8Pjk6ERKHIX/VoFJD82aj3cUowGwi6M5udv2XmxPFRKDTXNvTXWvRX5FidCD8 TWOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:subject:from :references:cc:to; bh=xFffsoz/cUW1I2NSstmz5f2IcyO6gT8WhToItXhjDtg=; b=QeAMatWf+qyvQw4OgP1wah8tfFPmWOHKyThjGkxZV/FH2MT8bUCOD2yLOSB/B4UvfU bWp85qYCuvmAfx8SxSKy/zC4l1OIu+HCfqS2GylHNxuOPOiihLaGXMYGrYM/Oi69l0FS X7kvI3sxQtEQsxQxFhnY1vzRS4BufiOB7ZHNiNvP6IZ3i95ecLoo1Y65VhNNgbUbs1FS YAWhiQ2zc4Aqx4+qk17wci4kO7gfgT2GVp3uOztLIcSQRTekOHu56XGUowq8ASj8Arwa Tg3OVVNz1s1bQxj1ASOH9PTIh3y/36yujjkzvHclc452IflIKAhhYvNlm8ej/KkfSyJB ChmQ== 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 dj27si8650002edb.398.2021.01.26.07.31.11; Tue, 26 Jan 2021 07:31:37 -0800 (PST) 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 S2406073AbhAZP3q convert rfc822-to-8bit (ORCPT + 99 others); Tue, 26 Jan 2021 10:29:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37186 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726430AbhAZJdW (ORCPT ); Tue, 26 Jan 2021 04:33:22 -0500 Received: from cc-smtpout1.netcologne.de (cc-smtpout1.netcologne.de [IPv6:2001:4dd0:100:1062:25:2:0:1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 99F27C06174A for ; Tue, 26 Jan 2021 01:32:04 -0800 (PST) Received: from cc-smtpin1.netcologne.de (cc-smtpin1.netcologne.de [89.1.8.201]) by cc-smtpout1.netcologne.de (Postfix) with ESMTP id DD3AA13A1F; Tue, 26 Jan 2021 10:31:13 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by cc-smtpin1.netcologne.de (Postfix) with ESMTP id CF7C111E75; Tue, 26 Jan 2021 10:31:13 +0100 (CET) Received: from [89.1.203.165] (helo=cc-smtpin1.netcologne.de) by localhost with ESMTP (eXpurgate 4.19.0) (envelope-from ) id 600fe161-031e-7f0000012729-7f000001c664-1 for ; Tue, 26 Jan 2021 10:31:13 +0100 Received: from nas2.garloff.de (xdsl-89-1-203-165.nc.de [89.1.203.165]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by cc-smtpin1.netcologne.de (Postfix) with ESMTPSA; Tue, 26 Jan 2021 10:31:08 +0100 (CET) Received: from [192.168.155.24] (ap4.garloff.de [192.168.155.15]) by nas2.garloff.de (Postfix) with ESMTPSA id F049FB3B13A5; Tue, 26 Jan 2021 10:31:07 +0100 (CET) To: Denis Efremov , Jiri Kosina , Jens Axboe Cc: linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, Wim Osterholt References: <20160610230255.GA27770@djo.tudelft.nl> <20160614184308.GA6188@djo.tudelft.nl> <20160615132040.GZ14480@ZenIV.linux.org.uk> <20160615224722.GA9545@djo.tudelft.nl> <9c713fa8-9da1-47b5-0d5d-92f4cd13493a@kernel.dk> <5cb57175-7f0b-5536-925d-337241bcda93@linux.com> <5ef748c9-9ab9-9a7e-6ae9-6e4a292b6842@linux.com> From: Kurt Garloff Subject: Re: [PATCH] floppy: reintroduce O_NDELAY fix Message-ID: Date: Tue, 26 Jan 2021 10:31:07 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: <5ef748c9-9ab9-9a7e-6ae9-6e4a292b6842@linux.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Denis, Jiri, Jens, Am 26.01.21 um 09:21 schrieb Denis Efremov: > On 1/22/21 2:13 PM, Jiri Kosina wrote: >> From: Jiri Kosina >> >> This issue was originally fixed in 09954bad4 ("floppy: refactor open() >> flags handling"). >> >> The fix as a side-effect, however, introduce issue for open(O_ACCMODE) >> that is being used for ioctl-only open. I wrote a fix for that, but >> instead of it being merged, full revert of 09954bad4 was performed, >> re-introducing the O_NDELAY / O_NONBLOCK issue, and it strikes again. >> >> This is a forward-port of the original fix to current codebase; the >> original submission had the changelog below: >> >> ==== >> Commit 09954bad4 ("floppy: refactor open() flags handling"), as a >> side-effect, causes open(/dev/fdX, O_ACCMODE) to fail. It turns out that >> this is being used setfdprm userspace for ioctl-only open(). >> >> Reintroduce back the original behavior wrt !(FMODE_READ|FMODE_WRITE) >> modes, while still keeping the original O_NDELAY bug fixed. >> >> Cc: stable@vger.kernel.org >> Reported-by: Wim Osterholt >> Tested-by: Wim Osterholt >> Reported-and-tested-by: Kurt Garloff >> Fixes: 09954bad4 ("floppy: refactor open() flags handling") >> Fixes: f2791e7ead ("Revert "floppy: refactor open() flags handling"") >> Signed-off-by: Jiri Kosina > Applied. I'll send it to Jens soon with a couple of cleanup patches. > > https://github.com/evdenis/linux-floppy/commit/e32f6163c47efbdbad06258560aa00d1c7e5b699 Great, thanks. Due to libblkid (rightfully) using O_NONBLOCK these days when probing devices, the floppy driver does spit loads of [    9.533513] floppy0: disk absent or changed during operation [    9.534989] blk_update_request: I/O error, dev fd0, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0 [    9.537206] Buffer I/O error on dev fd0, logical block 0, async page read [    9.546837] floppy0: disk absent or changed during operation [    9.548389] blk_update_request: I/O error, dev fd0, sector 0 op 0x0:(READ) flags 0x80700 phys_seg 1 and fails a mount prior to being opened without O_NONBLOCK at least once. (Reproduction is easy with qemu-kvm.) The patch addresses it and I would suggest it to also be backported and applied to the active stable kernel trees. Thanks, -- Kurt Garloff , Cologne, Germany