Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2022784ybi; Thu, 20 Jun 2019 07:54:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqzYoikIaAPHWhMNyiheMpRuwBbXIKnyXAW+2BRsbYOVWhw9jT8D+t1r8VuW11Xe7KC8dXTQ X-Received: by 2002:a17:90a:3787:: with SMTP id v7mr34741pjb.33.1561042448139; Thu, 20 Jun 2019 07:54:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561042448; cv=none; d=google.com; s=arc-20160816; b=Iwg0ENcpOule/zsblvoOzITRDdPqdURxpz3/nAC70iNZpKMouNWXgs/DktuKQ2lzeW oE+R8Yl/7YLIOh0v67ghanIkFt6oUJQhzP4v6Bpm2gcqprtvAN+n+SB/k1uA5vThNy6A ugA79ktbM4bCW20/taJFQCsB/6k9MkygHBDOgKmdBZcGDQECEBvvWSreFENhNrTiEZNR KzIOZdqAz48IeKexKp8aphjY5Eml7P3B2dDC2Npf5iIvXXaPQXCjQ7H6cTkgyi5puEAh 4+5sI1xnPk2rlD/yK0ZtIGiE6P6A0W44k/MsdGw9j9tCZ7VpS8EAggKjVD4SLVKehrnj viPQ== 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=SIcMrLziZYUEFo0cQhEbQEjSkt9HMxe+L6BtX2iDmxY=; b=RF8V7flcVNhF2hUClH+O4ieHyRyOcGEsY50P92zaOxvXdFf1Q1EmQWQiWW+BX+6crJ 1vWmb0D/LMpCkScQaMn9lxGqlXmkHCGr8oExKZ5hFAOl78wUbiPT31Lh6YvzPyzWF4Go 81cuUwfu453iZ8qQ7ysieSpplJl3HIQupE1eULd1W+c7jvr0dEzb1RlWwakKlcAJw1ER kberHcy/7Z5dW9cLnWgyUER3kz7sbf58M8UohkGZ6Y0t0efAHfmIxiwA87rCE/55lHOM 9gYX+mQlg72xIwRNIobM/OtMfEFgY17WbszNiuwi/EfvZCUnXzrot2yqma7GxEqZ/bD6 mEUA== 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 f17si26702pjq.18.2019.06.20.07.53.52; Thu, 20 Jun 2019 07:54:08 -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 S1732030AbfFTOw5 (ORCPT + 99 others); Thu, 20 Jun 2019 10:52:57 -0400 Received: from mx2.suse.de ([195.135.220.15]:60284 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726675AbfFTOw5 (ORCPT ); Thu, 20 Jun 2019 10:52:57 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 327B0AE32; Thu, 20 Jun 2019 14:52:55 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id AF6F01E434F; Thu, 20 Jun 2019 16:52:54 +0200 (CEST) Date: Thu, 20 Jun 2019 16:52:54 +0200 From: Jan Kara To: Matthew Wilcox Cc: Dave Chinner , Ira Weiny , 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, Jason Gunthorpe , linux-rdma@vger.kernel.org Subject: Re: [PATCH RFC 00/10] RDMA/FS DAX truncate proposal Message-ID: <20190620145254.GJ30243@quack2.suse.cz> References: <20190606014544.8339-1-ira.weiny@intel.com> <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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190613152755.GI32656@bombadil.infradead.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 13-06-19 08:27:55, 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 think you're partially wrong here. You are correct that the lease won't stop process A from doing truncate on the file. *But* there are still page pins in existence so truncate will block on waiting for these pins to go away (after all this is a protection that guards all short-term page pin users). So there is no problem with blocks being freed under the RDMA app. Yes, the app will effectively deadlock and sysadmin has to kill it. IMO an acceptable answer for doing something stupid and unsupportable... Honza -- Jan Kara SUSE Labs, CR