Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp321346ybi; Thu, 13 Jun 2019 16:59:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqxdkQNWhJ4uxYqyuvC9lYyq3qJ1+dWQ7HQ58E6Mpehr44UA5sfILAp5QUO14vLLnIAhchAH X-Received: by 2002:a62:ce4f:: with SMTP id y76mr12738659pfg.21.1560470352364; Thu, 13 Jun 2019 16:59:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560470352; cv=none; d=google.com; s=arc-20160816; b=KQ5iIrRzTYo3ObJegUBgZ+gOw7+e/bt013xIQuv0WT83tBl3Jf278oJ3zjvdq0mSHt 96bTmLRDBPMlhPkZLv2Ow0caC/OuDkZjZDNtQPEX+c/2gwAdnWE2gj+H/LXxrYaHA+/Q mQV07aK7U1zUCvrCaJ+IUN20+y2n4RmNGWeHlFLH14JT2bsIeeOLIRlHyrprhj4jP7HH iZrzrfYAaPz6CY2vhlvzv3eXSswiHZH3wn4iibU2xNR2ilR2p7r2J4lLHadqFiHjyo9b 4ssQNSUNnMRirkvWhgLcdU1+HtO9O1F4xyJGfbTEg/rkxpprZ0/3UYT5pOXiQaf6T1f/ cYIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=fHCZCkYS3xfgL7YswiEhaH5vXkW2o8h20LOkbgBn1RU=; b=XmWQphl8rdEr1E8z5HJ30I58u6q2d2rdz32aaIjSi1imlW7sw3ASD2GN7GHT3DFtSS KSnFfZHprmvF6OZQ/Cd9GA4mQVm/RgxxFLRsqhBhHFYQJNPCqDRRjT5kAEByiYtvvN30 FXreuRVFj7rZgc5sdjYNRLXDZxIU//rZphc65hR8O/PBbq5Dcd9bPL+achxF3BySssQu NtRZxVyKF4UMqJjfI+sRS/BAMnPgQxkPUtfEXZcD/BwuFqVDolQaJbgZTbN1pFp+nXpk pbPX6PfySJfuoMAzr0NZZeJDrvI7JXVpBpQdGvORoLZbjdb3+Crzsr/lTuisd8xLD/Y0 zdFg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c145si785346pfb.9.2019.06.13.16.58.54; Thu, 13 Jun 2019 16:59:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-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-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726785AbfFMX6u (ORCPT + 99 others); Thu, 13 Jun 2019 19:58:50 -0400 Received: from mga06.intel.com ([134.134.136.31]:12081 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725836AbfFMX6u (ORCPT ); Thu, 13 Jun 2019 19:58:50 -0400 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Jun 2019 16:58:49 -0700 X-ExtLoop1: 1 Received: from iweiny-desk2.sc.intel.com ([10.3.52.157]) by fmsmga007.fm.intel.com with ESMTP; 13 Jun 2019 16:58:49 -0700 Date: Thu, 13 Jun 2019 17:00:11 -0700 From: Ira Weiny To: Jason Gunthorpe Cc: Matthew Wilcox , Dave Chinner , Jan Kara , Dan Williams , Theodore Ts'o , Jeff Layton , linux-xfs@vger.kernel.org, Andrew Morton , John Hubbard , =?iso-8859-1?B?Suly9G1l?= Glisse , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvdimm@lists.01.org, linux-ext4@vger.kernel.org, linux-mm@kvack.org, linux-rdma@vger.kernel.org Subject: Re: [PATCH RFC 00/10] RDMA/FS DAX truncate proposal Message-ID: <20190614000010.GA783@iweiny-DESK2.sc.intel.com> References: <20190606104203.GF7433@quack2.suse.cz> <20190606220329.GA11698@iweiny-DESK2.sc.intel.com> <20190607110426.GB12765@quack2.suse.cz> <20190607182534.GC14559@iweiny-DESK2.sc.intel.com> <20190608001036.GF14308@dread.disaster.area> <20190612123751.GD32656@bombadil.infradead.org> <20190613002555.GH14363@dread.disaster.area> <20190613152755.GI32656@bombadil.infradead.org> <20190613211321.GC32404@iweiny-DESK2.sc.intel.com> <20190613234530.GK22901@ziepe.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190613234530.GK22901@ziepe.ca> User-Agent: Mutt/1.11.1 (2018-12-01) Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Thu, Jun 13, 2019 at 08:45:30PM -0300, Jason Gunthorpe wrote: > On Thu, Jun 13, 2019 at 02:13:21PM -0700, Ira Weiny wrote: > > On Thu, Jun 13, 2019 at 08:27:55AM -0700, Matthew Wilcox wrote: > > > On Thu, Jun 13, 2019 at 10:25:55AM +1000, Dave Chinner wrote: > > > > e.g. Process A has an exclusive layout lease on file F. It does an > > > > IO to file F. The filesystem IO path checks that Process A owns the > > > > lease on the file and so skips straight through layout breaking > > > > because it owns the lease and is allowed to modify the layout. It > > > > then takes the inode metadata locks to allocate new space and write > > > > new data. > > > > > > > > Process B now tries to write to file F. The FS checks whether > > > > Process B owns a layout lease on file F. It doesn't, so then it > > > > tries to break the layout lease so the IO can proceed. The layout > > > > breaking code sees that process A has an exclusive layout lease > > > > granted, and so returns -ETXTBSY to process B - it is not allowed to > > > > break the lease and so the IO fails with -ETXTBSY. > > > > > > This description doesn't match the behaviour that RDMA wants either. > > > Even if Process A has a lease on the file, an IO from Process A which > > > results in blocks being freed from the file is going to result in the > > > RDMA device being able to write to blocks which are now freed (and > > > potentially reallocated to another file). > > > > I don't understand why this would not work for RDMA? As long as the layout > > does not change the page pins can remain in place. > > Because process A had a layout lease (and presumably a MR) and the > layout was still modified in way that invalidates the RDMA MR. Oh sorry I miss read the above... (got Process A and B mixed up...) Right, but Process A still can't free those blocks because the gup pin exists on them... So yea it can't _just_ be a layout lease which controls this on the "file fd". Ira