Received: by 2002:a05:6a10:8a4d:0:0:0:0 with SMTP id dn13csp533040pxb; Fri, 13 Aug 2021 00:04:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzqkzaACFwYrhFjHufa4915W4/Wttsuk3M9vJUnsq8Qt31RQTEQ61pOTMWVdRoiOksf+K38 X-Received: by 2002:a6b:8ec6:: with SMTP id q189mr895122iod.169.1628838258248; Fri, 13 Aug 2021 00:04:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628838258; cv=none; d=google.com; s=arc-20160816; b=yalt/2BgOzZLkzF8Qdbw9wEw1geeCs7DtjRni6+eJTWKB5cFNJlucucHH0XBOxKsyY AQmlq+ArfGnzp7wQXERXECruX5WMa5nrwSfPij4UWcdXDlYyoeQgkIT9x7lGzfeai7Vh pExYtAPyViKXbLPnaQbnZmsQtJRS/6GEdx3VvUCURvTvqMioqLHgbaG88bzMDDrtmBAQ eJpraFM9gGjwf0BkhSNBuiRw51SfOfHhvI60CKybNtEiE0DOf6/cGVOK1hddcqpO1kYS AUOI12AGvw4NYIZAOpYzubb7jz3sST4cHeYTuSvhVRmdDfggOfsvXkuHcr+dgfQbk4uF kM9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=HLB540yyXvdc1vV1wKIR3OI3HMTZQCZSpleOm6w1vVQ=; b=OPsC2muNQvNaIph/5RCoL/HEDxHgYXaAu+DrSP8PsbTY/CXnUuAjo6pK/1y1hFzHfR gbKzXndOXAFC1eTcaCA0xsh0iz2g7i8DF6T8EmI1yiMtQCdyi01+dtwl/+Q/Ls4ITdZP jY4161npsaTFL0wkUMLdNHX4DBKJRZ+s553us6rXzMgT38xTdutuHtwx46I490xeeqP7 IGq8n5V49xH/7EuE0i9UJ+jSAJmO8XMAdbU3R/WDZZuR7++4BMhVlVrI5gV1bHRIuobX oSKQUgvUPqDpUb1q5tdBIIKKuaN6vYt/zAjGZSKfeGHYeVrDKMU3Z8AXEJwCmyGl3anE qqdg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t12si633148jal.3.2021.08.13.00.04.06; Fri, 13 Aug 2021 00:04:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239133AbhHMHDC (ORCPT + 99 others); Fri, 13 Aug 2021 03:03:02 -0400 Received: from verein.lst.de ([213.95.11.211]:46539 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238877AbhHMHDB (ORCPT ); Fri, 13 Aug 2021 03:03:01 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 8132E6736F; Fri, 13 Aug 2021 09:02:31 +0200 (CEST) Date: Fri, 13 Aug 2021 09:02:31 +0200 From: Christoph Hellwig To: Matthew Wilcox Cc: David Howells , "Darrick J. Wong" , Christoph Hellwig , Trond Myklebust , linux-nfs@vger.kernel.org, viro@zeniv.linux.org.uk, jlayton@kernel.org, sfrench@samba.org, torvalds@linux-foundation.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH v2 1/5] nfs: Fix write to swapfile failure due to generic_write_checks() Message-ID: <20210813070231.GA26339@lst.de> References: <162879971699.3306668.8977537647318498651.stgit@warthog.procyon.org.uk> <162879972678.3306668.10709543333474121000.stgit@warthog.procyon.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Fri, Aug 13, 2021 at 04:09:39AM +0100, Matthew Wilcox wrote: > On Thu, Aug 12, 2021 at 09:22:06PM +0100, David Howells wrote: > > Trying to use a swapfile on NFS results in every DIO write failing with > > ETXTBSY because generic_write_checks(), as called by nfs_direct_write() > > from nfs_direct_IO(), forbids writes to swapfiles. > > Why does nfs_direct_write() call generic_write_checks()? > > ie call generic_write_checks() earlier, and only swap would bypass them. Yes, something like that is a good idea probably. Additionally I'd like to move to a separate of for swap I/O ASAP given that NFS only implemens ->direct_IO for swap.