From patchwork Thu Feb 14 22:13:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Finn Thain X-Patchwork-Id: 10813939 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 588131390 for ; Thu, 14 Feb 2019 22:25:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 42A4D2E702 for ; Thu, 14 Feb 2019 22:25:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 31C3E2EEDE; Thu, 14 Feb 2019 22:25:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D08242E702 for ; Thu, 14 Feb 2019 22:25:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727117AbfBNWYx (ORCPT ); Thu, 14 Feb 2019 17:24:53 -0500 Received: from kvm5.telegraphics.com.au ([98.124.60.144]:46786 "EHLO kvm5.telegraphics.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2440475AbfBNWXA (ORCPT ); Thu, 14 Feb 2019 17:23:00 -0500 Received: by kvm5.telegraphics.com.au (Postfix, from userid 502) id 6C29729BE1; Thu, 14 Feb 2019 17:22:55 -0500 (EST) To: Jens Axboe Cc: linux-m68k@lists.linux-m68k.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Message-Id: <34350e8aeb63c19f5b204c3f7b961a99708b50ff.1550182390.git.fthain@telegraphics.com.au> From: Finn Thain Subject: [PATCH] block/swim: Return -EROFS for FMODE_WRITE Date: Fri, 15 Feb 2019 09:13:10 +1100 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Write requests are not supported by the driver and result in IO errors: print_req_error: I/O error, dev fd0, sector 0 buffer_io_error: 26 callbacks suppressed Buffer I/O error on dev fd0, logical block 0, lost async page write Buffer I/O error on dev fd0, logical block 1, lost async page write Buffer I/O error on dev fd0, logical block 2, lost async page write Buffer I/O error on dev fd0, logical block 3, lost async page write Buffer I/O error on dev fd0, logical block 4, lost async page write Buffer I/O error on dev fd0, logical block 5, lost async page write Buffer I/O error on dev fd0, logical block 6, lost async page write Buffer I/O error on dev fd0, logical block 7, lost async page write Buffer I/O error on dev fd0, logical block 8, lost async page write Buffer I/O error on dev fd0, logical block 9, lost async page write print_req_error: I/O error, dev fd0, sector 2688 print_req_error: I/O error, dev fd0, sector 0 Cc: linux-m68k@lists.linux-m68k.org Tested-by: Stan Johnson Signed-off-by: Finn Thain --- drivers/block/swim.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/block/swim.c b/drivers/block/swim.c index 3fa6fcc34790..dd19f422fb0d 100644 --- a/drivers/block/swim.c +++ b/drivers/block/swim.c @@ -643,7 +643,7 @@ static int floppy_open(struct block_device *bdev, fmode_t mode) if (mode & (FMODE_READ|FMODE_WRITE)) { check_disk_change(bdev); - if ((mode & FMODE_WRITE) && fs->write_protected) { + if (mode & FMODE_WRITE) { /* not implemented */ err = -EROFS; goto out; }