Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp4006685ybd; Tue, 25 Jun 2019 12:18:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqyDw9rfGAcxb8z8DL7VFh4BlzEBTQqZS8ny45RaT2WijNdL3ukowyUG9tudsqtDvarJk/BW X-Received: by 2002:a63:60c8:: with SMTP id u191mr4840967pgb.401.1561490321872; Tue, 25 Jun 2019 12:18:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561490321; cv=none; d=google.com; s=arc-20160816; b=wUDM+VckpLFOhOu4I59lNG6VtqT8xfHe19htABXNIONA4KToZHtyUIfCSDVbU78LVY o0AvM6fK0snbYdhC04w6yyqZL5V+PXz7I5U0WL23exmGQY5Kt9EBxe/4b+OyuIU05pl/ /f5OnoyH7uoi0EuYT79SKE1YPZjWLBVucU2FHNBWE8iqxvX2yYj/cZ15RnhzbKZFqWWS /C/HeXZOVuvDJUIq+QtY5B/3QgcceWh/fG233uF9wADENWkO8WHy6AuvFX9QiT+FnMI4 /fsjKd71Nsh/6UrEVmcXS6GX/qzJuWTUGYm610Wprn0eWm1D7Gsoh+VJqZvg586uwhLO 2U/Q== 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; bh=X8PyZ6mm09HvpAjBsN2bzxK8nd8cfLA+VCOhqGU8yjE=; b=jqeN4HxWTjFKBvjZRrM2TUBGAXzMbCPrtTl572IkiOEovVDBBK77MBH7EY45B1cwtF jfz6nDWFVFEZUU4KG6uKdh9AZ6UENZSmwcqvCesMaDLZNP+3PVBYopjgXyX+jQ6pl40U ntrWzu+/xlokSo41OWeWodQOzWfv2z0kJeWVMVREuPfFfRjsWXj/3pQjzBKVPWjxH1N0 g06P8aOrN++6MjqhJSpIe/Vkms0ch5CVR/AFBq1pDtaWWSqaM8lpd1o+BLMDGvBDE5gw tnVQtNq+/soeoNlvwMuc0nwOsZ7Hei69oEleypPDECpbtoGNEUvljq/4ZXTRPG2JsVK3 a+Rg== 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 gn22si956378plb.422.2019.06.25.12.18.26; Tue, 25 Jun 2019 12:18:41 -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 S1731345AbfFYP4A (ORCPT + 99 others); Tue, 25 Jun 2019 11:56:00 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:36080 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726053AbfFYP4A (ORCPT ); Tue, 25 Jun 2019 11:56:00 -0400 Received: by mail-pl1-f195.google.com with SMTP id k8so9085025plt.3; Tue, 25 Jun 2019 08:55:59 -0700 (PDT) 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=X8PyZ6mm09HvpAjBsN2bzxK8nd8cfLA+VCOhqGU8yjE=; b=I5N7UWptXauuBXj0zCCEqNUP6Ikcvnh0iUfEdHUe9jMdkFcxlT+nI2FFF/9d3LfmlE 5KD1XFPShCo6Nht+1WjDMfGYv+TrBU4jyEa2mQ2W0om0iL+AcQSpTZasjMKCcoV0VpGw ixao1WARIi0zXaeqiKgan6dAvCL6Tb6PAbboSzerx6n5NJU5l384Zf8dJvORmE7q9hvE Zz3P9gEkZWK5jpCReQx7JWMT2pEUTU1pCKJuby0CTm3zmPngK6LQTDKHlvxoSZnZku62 LGrZP60u7GgFaXAia9hICu3UEEMmgHUwjDk3ktpIZDN6kpW3wO4ONonAbcbi9MtlhMkM uKig== X-Gm-Message-State: APjAAAVsLAKAArFUE7xVSOwdWZ1rqY0D9CMQqu56xEM356Dff/r6MYpD lQHZ6fvquh8fhqfGFQauCBY= X-Received: by 2002:a17:902:8203:: with SMTP id x3mr72155467pln.304.1561478159207; Tue, 25 Jun 2019 08:55:59 -0700 (PDT) Received: from desktop-bart.svl.corp.google.com ([2620:15c:2cd:202:4308:52a3:24b6:2c60]) by smtp.gmail.com with ESMTPSA id 5sm14545676pfh.109.2019.06.25.08.55.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Jun 2019 08:55:58 -0700 (PDT) Subject: Re: [PATCH 1/4] block: add zone open, close and finish support To: =?UTF-8?Q?Matias_Bj=c3=b8rling?= , Chaitanya Kulkarni , "axboe@fb.com" , "hch@lst.de" , Damien Le Moal , Dmitry Fomichev , Ajay Joshi , Aravind Ramesh , "martin.petersen@oracle.com" , "James.Bottomley@HansenPartnership.com" , "agk@redhat.com" , "snitzer@redhat.com" Cc: "linux-block@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-scsi@vger.kernel.org" , "dm-devel@redhat.com" , Matias Bjorling References: <20190621130711.21986-1-mb@lightnvm.io> <20190621130711.21986-2-mb@lightnvm.io> From: Bart Van Assche Message-ID: <79ca395d-8019-9ec8-0c0b-194ca6d9eda0@acm.org> Date: Tue, 25 Jun 2019 08:55:56 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed 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 6/25/19 3:35 AM, Matias Bjørling wrote: > On 6/25/19 12:27 AM, Chaitanya Kulkarni wrote: >> On 6/24/19 12:43 PM, Bart Van Assche wrote: >>> static inline bool op_is_write(unsigned int op) >>> { >>>     return (op & 1); >>> } >>> >> > > The zone mgmt commands are neither write nor reads commands. I guess, > one could characterize them as write commands, but they don't write any > data, they update a state of a zone on a drive. One should keep it as > is? and make sure the zone mgmt commands don't get categorized as either > read/write. Since the open, close and finish operations support modifying zone data I propose to characterize these as write commands. How about the following additional changes: - Make bio_check_ro() refuse open/close/flush/reset zone operations for read-only partitions (see also commit a32e236eb93e ("Partially revert "block: fail op_is_write() requests to read-only partitions"") # v4.18). - In submit_bio(), change op_is_write(bio_op(bio)) ? "WRITE" : "READ" into something that uses blk_op_str(). - Add open/close/flush zone support be added in blk_partition_remap(). Thanks, Bart.