Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp176461ybi; Fri, 7 Jun 2019 06:16:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqxRjFe/ID8z7t15LVbXYfxiK65QecCPgsd9JN+D/Gt/PNPr5a9CfmIo4nCR5Ds0VG7stOXQ X-Received: by 2002:a65:6495:: with SMTP id e21mr2568981pgv.383.1559913397888; Fri, 07 Jun 2019 06:16:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559913397; cv=none; d=google.com; s=arc-20160816; b=EsvWw6aXGzx5rq9Jvhn4G3D54ctEXWHgrpoHG0/nc6yvv0DT2tUK02BtIFjzPBgYNx g71xNgN8HUALBCpuY/Izko9Ey/ZunWqZNuBMIB7q8CMrtySQkyiOT7lzkw16gBeE1iCV QDP97Fvr/g7v1Q/dAANgeIilBD3tpEX4F3iG1IubAOIo9Z9Cez6FpdOB8YPmChcCmgfL kdpeBPPuQ0mXqkpJtJIKtkclCUqz/EEVABnxUEPs0vbihIh+mp0Hred3YwgBWyWgg+qh cZTkNauzRu52YdzpL1MySxtbjf9wU4eu8Cqi5Phv3Lr6slU+ogx0fzgI34N73SaCPbQa wmJA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :ironport-sdr:ironport-sdr:dkim-signature; bh=JBpLm32WfS8plSeYqwhK+31b+ifkC1V4mFmtgZBCUrs=; b=H5cE2i0Ey9h2XEp0Aw/D0JADryLtWydKuFoJ+vuzk0pSYyR2Re1wqEoH4dleBb4xpS bibpeSDEb+ijpNYnWUHRWW3MZOJocnnmnUcdRI8umMWR+tbwWqeAd6F/4SOYAsZ/XspK UeELyhnhe5p6GNgS2+atQDqFXCYsmbwJn6aq2MXmLQgHkh7oHgKGusS+AOsTSm1HNXiY txVIUr+H7G1YZDqrZ8kAIPkpAKC6g5h6XVkeNEwopmtWZvJmtt0PWsmmkdjyexKGSwxK EC6eZGEjYTiZZFm8ydmAtcWy7LRr8/ACYODPBdj6BNrZtrwa2ZEmMvbiDerS7jfki10D /RKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=D6jZBY8n; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=wdc.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ba6si1649252plb.436.2019.06.07.06.16.20; Fri, 07 Jun 2019 06:16:37 -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; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=D6jZBY8n; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=wdc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729137AbfFGNL0 (ORCPT + 99 others); Fri, 7 Jun 2019 09:11:26 -0400 Received: from esa4.hgst.iphmx.com ([216.71.154.42]:53172 "EHLO esa4.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728932AbfFGNLX (ORCPT ); Fri, 7 Jun 2019 09:11:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1559913083; x=1591449083; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=xqnDdtcrbB/JuA69zVboBOpPg+hMLEFntRJfoMfWmVE=; b=D6jZBY8nytzqV8nzHZotEopg1kOiSaNUPMHkCsX0x4evNSIbMk3zu0xY EK1Wyy/HREzQ4u5D6xJ/jqRE8V8FNY6lClNP3eq4Ujia6TmiNBecfYW6I CT/HygpB11aWnQsDYKgk7TMKyVDX/ypZazegXGU8svMS8z6+LLvOYh10a hcOekk49w0PpK12PlzZ3967+eROcJOB+3pc7dKkIsOFvbv3BrzYX4G2TX aEEI8rNsVvmL1gbsRa8UWaU53x8bfZ2ZO40lR37LO02VVUIsI8nw7KP62 em1VM62cDiX6Hb2lOOOCW8Oy5MutwwwZ7R9N/eWoH38dB0OKH4ZqVSU7x g==; X-IronPort-AV: E=Sophos;i="5.63,563,1557158400"; d="scan'208";a="110027786" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 07 Jun 2019 21:11:23 +0800 IronPort-SDR: p1i5SJ9Gkevvu9Ac5/JCfeb9kBSps/bGLwNMEsQb/pjl7y5dgB77+0TlRB46bC8H/00gZFXPW3 0CQLTLFZEX6newzAyzu0YJX2GMnm3XWgdc7tnQxi3jM8510zivrarSacpksHNU2olIKUnYrGui bYZayL9NEV1lgmAcJAQa4ujDpJEFPMSgN6D22actEwDQPDfnOZnrlg9RcDcAl4RWANAO2q3Jus zzYRQdJCvoOVK9aMiCepTnXno0x+3+grHQ5lqJRsskgbjzrQPcMskC7f17LIzeFeAw4PJFeazh 62hFYrg9ZlQhI3xSXLwo+F4d Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP; 07 Jun 2019 05:48:40 -0700 IronPort-SDR: ZkdpoyZeYXGA6DvrPn+rNtzz+woX9jTuSHowB6NDPVP4u2BMZsWyaLpqxeyMjN8tG39U2MTOSK U1ojklXNwTbbdUmJ3VBD/A/Rq6ou5d+4VM8T1s9Hj7lp6JtY1/LEUdwlYY2i9qFDPE0GblK2E2 J5gcbC0SetZ+3ggH0xiLEQRcQfUJ5IIxuEDpmSfLGa+aIXClwCTXiezmMyTAqj6DBKc4sHrECe S7MfeZekClyCcw11njl4dtxqYaHfoax+uNxPPGlvyv8uqWsilj4Xpc66wT0KIHPq0hDaw1ZTaR c8I= Received: from naota.dhcp.fujisawa.hgst.com (HELO naota.fujisawa.hgst.com) ([10.149.53.115]) by uls-op-cesaip02.wdc.com with ESMTP; 07 Jun 2019 06:11:21 -0700 From: Naohiro Aota To: linux-btrfs@vger.kernel.org, David Sterba Cc: Chris Mason , Josef Bacik , Qu Wenruo , Nikolay Borisov , linux-kernel@vger.kernel.org, Hannes Reinecke , linux-fsdevel@vger.kernel.org, Damien Le Moal , =?UTF-8?q?Matias=20Bj=C3=B8rling?= , Johannes Thumshirn , Bart Van Assche , Naohiro Aota Subject: [PATCH 05/19] btrfs: disable direct IO in HMZONED mode Date: Fri, 7 Jun 2019 22:10:11 +0900 Message-Id: <20190607131025.31996-6-naohiro.aota@wdc.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190607131025.31996-1-naohiro.aota@wdc.com> References: <20190607131025.31996-1-naohiro.aota@wdc.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Direct write I/Os can be directed at existing extents that have already been written. Such write requests are prohibited on host-managed zoned block devices. So disable direct IO support for a volume with HMZONED mode enabled. Signed-off-by: Naohiro Aota --- fs/btrfs/inode.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 6bebc0ca751d..89542c19d09e 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -8520,6 +8520,9 @@ static ssize_t check_direct_IO(struct btrfs_fs_info *fs_info, unsigned int blocksize_mask = fs_info->sectorsize - 1; ssize_t retval = -EINVAL; + if (btrfs_fs_incompat(fs_info, HMZONED)) + goto out; + if (offset & blocksize_mask) goto out; -- 2.21.0