Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2340708imm; Thu, 9 Aug 2018 11:09:30 -0700 (PDT) X-Google-Smtp-Source: AA+uWPz0KLBirVf+IYR5p/84oCVsOWEIygHyGhEcAxy6uDCEawoL2Ahp0zcmR4jTvicgzkHq1s+i X-Received: by 2002:a17:902:8a8e:: with SMTP id p14-v6mr2933169plo.213.1533838170320; Thu, 09 Aug 2018 11:09:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533838170; cv=none; d=google.com; s=arc-20160816; b=kXhNcN0/uGwNNkemC3aDsYvuvAaLydS+x6UfO6LvrFFp3k0pwsMuf1aCaCzvb093QB iGXuOdTRGaZiawxjkmg8M2MLb5vkAzyZIio2jXmzLzR4EUOjGgroCrCJ8GHwlVe9mRE4 7o0LYkpBukhsvfoBqSXyoC1iR1KrRUM21O/zhmvMdf+q08Yd2551RfVrJRc4y/to1T0S 0M4j87CFYIiPMjGdJe3iLbXhgyckw68PI+phunjYYu83WeBchmOCCfAcK3QYZGQ7Ltp8 5hWXdurvfhwywd9CCvrtr7NwDjJ+07CJnLqU5u4tcY5w9Y0IY0zswhyEAeHaUPiQyaD0 aaRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=RFAEmNnOCZ/Kp9MrXLAGDUXGdn+QYEpwfWj/EYZS03E=; b=Uql6Uor54FaVQe/D+9iAeNg2BrAJMiHdhgoclQyWG+n5jfbcToHxnjPiQFqoxljaAw caWlmTLLPD8oT0g+EMzlEFR5tn3grA3GM72aBomW33Etzc/rm11I/ImqWd+ZCHEi51Lf fkvgYl3sRouE8AHJVZXkD1VrDBZ3jjQCf9iMeCpYl6xbpH2MA2y8rzgInUkGLRCYimuB C+BrVt3OzBN4YBSPCNCinS5wAnx2Xtpi9TNvtw9228Xq4FW57OVGW86AbbNMqPMSj+3J Uefy9/54xPMYKwoIDowkOKPqfcYx3RRrqnetD5fpVIMLkQbkAQM0hDQpieMAKoE4S4ER bFKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=gPQIoQ4l; 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 14-v6si7643157pgc.179.2018.08.09.11.09.16; Thu, 09 Aug 2018 11:09:30 -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=@gmail.com header.s=20161025 header.b=gPQIoQ4l; 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 S1727316AbeHIUcC (ORCPT + 99 others); Thu, 9 Aug 2018 16:32:02 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:38890 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726944AbeHIUcB (ORCPT ); Thu, 9 Aug 2018 16:32:01 -0400 Received: by mail-pf1-f196.google.com with SMTP id x17-v6so3213653pfh.5; Thu, 09 Aug 2018 11:06:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=RFAEmNnOCZ/Kp9MrXLAGDUXGdn+QYEpwfWj/EYZS03E=; b=gPQIoQ4lIVOzADQ7cuVb38GRq3XQ+5Nc/eTdm73tvxZJfcYlpN7o5miXBIiYV9ORT2 gaApJ1K5rwvwvJ7hccpRkvs0ThWcFLBdXnvsGToK/9CrC/ixiCIxhLaqCk8hOhg16/mv QvGbtK4hH3XGQJkEvCCLEeEgoIrMFSwobVzeM2Jrv5vFw/su7j5k7sZbx9VckCoHtjWC CExZQS5S0sJ3J3HHRUxVC+d7kNRDACZ2WYBvZyFZdcsy9pEcfyt64Dvqq/vFeaMVS9/w +lBTxo2sNeRlkw/CXix7e3EUbXTY9TumftHuLr1aGDTMepERkBqRza4m0HqsVhVVFUyL o3Sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=RFAEmNnOCZ/Kp9MrXLAGDUXGdn+QYEpwfWj/EYZS03E=; b=PrvXXmXo9IQoXiQjoCXZyy6HqejQxPVbrilnjywrgEdzH5fxKc7sw9bpkPgQvjjcB0 FvFdhYMvLgHuNrgPyd8kBn5tgTklFweokWjRQvrOWgPYHNQrcENgnCOIfjp+D1jnTEyq Mda4msKng6qcEvcdpgfmsVTlPBzKAXUGRc1lMvAMuKhtvW9IVvzwCyxXBxZotwodx0CB 7vgDO73ypnLLjRNjg8go5eV9DSpY836WLL1+x/jKhVJhYzJ/e1w0PXuny6IHd4pfYEjA /U2uliMN49n47h2Vd1nz20nEuPQ4+KBevfphwyDtHorLJ/zmvFA2BvkGmgCyyPa6MnE9 7B5Q== X-Gm-Message-State: AOUpUlHgdylyy49ISPLAtRXX30bhrwHbA+x+sKSDWYp/T63pF8G3TwKz hLfBVzSc5vNGSi/mVlE+pZQ= X-Received: by 2002:a62:ccd0:: with SMTP id j77-v6mr3437875pfk.22.1533837962594; Thu, 09 Aug 2018 11:06:02 -0700 (PDT) Received: from localhost (h101-111-148-072.catv02.itscom.jp. [101.111.148.72]) by smtp.gmail.com with ESMTPSA id n9-v6sm13285315pfg.21.2018.08.09.11.06.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Aug 2018 11:06:01 -0700 (PDT) From: Naohiro Aota To: David Sterba , linux-btrfs@vger.kernel.org Cc: Chris Mason , Josef Bacik , linux-kernel@vger.kernel.org, Hannes Reinecke , Damien Le Moal , Bart Van Assche , Matias Bjorling , Naohiro Aota Subject: [RFC PATCH 06/17] btrfs: disable direct IO in HMZONED mode Date: Fri, 10 Aug 2018 03:04:39 +0900 Message-Id: <20180809180450.5091-7-naota@elisp.net> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180809180450.5091-1-naota@elisp.net> References: <20180809180450.5091-1-naota@elisp.net> 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 212fa71317d6..05f5e05ccf37 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -8523,6 +8523,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.18.0