Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp730095imm; Thu, 13 Sep 2018 06:57:40 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZr7PcB1OxeJckJ3DgvjsdhzUj04gQgBAVMnn8Hh4IIT8PNxBaKAGrGXjK741shwzSfm4Xc X-Received: by 2002:a63:221b:: with SMTP id i27-v6mr7148291pgi.212.1536847060714; Thu, 13 Sep 2018 06:57:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536847060; cv=none; d=google.com; s=arc-20160816; b=RhBQjPTNoop7pqFryIw0soSaPyW1nO/9UR7GwnoGoW9Pw/q1/08Dxoq4vVDIJPmWPR TWb2dsNGxkXPv3Mfzr3WMJcNCxpNDqqiXtfRz7GNcTJKptWeG0opcUPsTADrdgcKXB2l RIiIx1rvI2hb3Vx/eBl6ipKJP7r/p6m8Y7d8LVIBVCabIjNZtmlCbxKqm1JuvzfYSFi/ sHVDOuW5L/pvwC8MSq1c/KTJnh66CLp8y2pxeFkPUgEF49g0rVDLdRfh5e5Y0LPDpU/I YETGieAI+M2GPUTSGbcxWUPQ3+AT5TT4ej+IFXNviH2OYH4W4vBrimRCceSxemNepD0P tyUw== 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:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from; bh=CW5Raro+yuAUGFQ+foFdMLgNMw6UXhs9fgbyhRvcoqE=; b=IJ7LYjzLszbKN02mUqCmiMRIDkREdzd2GlxprHr/QFUwty/aTrUIvRaF+E2wGNNjbL f58DBuc6zCYTYHYc0aPbIEh1iEruMF6hojLycFvgs8lSvkTL51nz3C/FAW9ZoccHANXx DSCCcjypU8EpStsm5QklBiyCPoEF0nSRlsUUo24EL+DTV+d1XZlMBFfgP2t8R2tvLgLW 5d66Zulbv6gORGMPhYVcWeeLvg1nt1BDhKsTa10y2x1v45kGiE+HsjMliUk2pFLjbZ95 uELIO73a4ezArJ1uHLrbWfm3cNQpGW1nlxXm5NawafsbMX75/aaKZTL67S01+YYJDy05 k2mg== ARC-Authentication-Results: i=1; mx.google.com; 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 o1-v6si4073079pld.223.2018.09.13.06.57.25; Thu, 13 Sep 2018 06:57:40 -0700 (PDT) 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; 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 S1731330AbeIMTFi (ORCPT + 99 others); Thu, 13 Sep 2018 15:05:38 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:34090 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730589AbeIMTFh (ORCPT ); Thu, 13 Sep 2018 15:05:37 -0400 Received: from localhost (ip-213-127-77-73.ip.prioritytelecom.net [213.127.77.73]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id DE85FD19; Thu, 13 Sep 2018 13:56:00 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Stefan Agner , Jens Axboe , Sasha Levin Subject: [PATCH 4.18 082/197] block: dont warn for flush on read-only device Date: Thu, 13 Sep 2018 15:30:31 +0200 Message-Id: <20180913131844.815669025@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180913131841.568116777@linuxfoundation.org> References: <20180913131841.568116777@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jens Axboe [ Upstream commit b089cfd95d32638335c551651a8e00fd2c4edb0b ] Don't warn for a flush issued to a read-only device. It's not strictly a writable command, as it doesn't change any on-media data by itself. Reported-by: Stefan Agner Fixes: 721c7fc701c7 ("block: fail op_is_write() requests to read-only partitions") Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- block/blk-core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/block/blk-core.c +++ b/block/blk-core.c @@ -2159,7 +2159,9 @@ static inline bool should_fail_request(s static inline bool bio_check_ro(struct bio *bio, struct hd_struct *part) { - if (part->policy && op_is_write(bio_op(bio))) { + const int op = bio_op(bio); + + if (part->policy && (op_is_write(op) && !op_is_flush(op))) { char b[BDEVNAME_SIZE]; WARN_ONCE(1,