From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7B02BC169C4 for ; Thu, 31 Jan 2019 21:13:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 371E020869 for ; Thu, 31 Jan 2019 21:13:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="qFLhVc2r" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726355AbfAaVNy (ORCPT ); Thu, 31 Jan 2019 16:13:54 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:43328 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725730AbfAaVNy (ORCPT ); Thu, 31 Jan 2019 16:13:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=MzS9DgXqJ/71s2EQnDgSsAsMs+OBMKnEpeUhlFuggE4=; b=qFLhVc2rNL5ZmxTV36mfvT+fI STF8gFhEGIPIvhBhO7WARlwbQAXkXB9fFTqJ3009a8UvRSloMI5qYNRx18BBYpAwYxlhPIVBbWLZg A5GdvGoXDZffhzLjKZbaItYZRNkY9Xp0SAMiEF4GssTK5BuWvGOhkuW2gAnCVC0vo37hNkJ3U0kx1 jbGUw4riFA5oSuJUAOnCU27mh7Ox5LHSXPz+FpxLJZH0zGoDfhRR4P6608Juj3xUY1Fvm9jyDVm9U 3wOJBF4uGzKA/oqZptlMOFremMBD6GKRCHaMcoN0mJZSzRy9794bs6GvdSOGgRJPXVUc8vmOZT85N fcLX+MUIg==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1gpJeh-00065Q-JQ; Thu, 31 Jan 2019 21:13:51 +0000 Date: Thu, 31 Jan 2019 13:13:51 -0800 From: Matthew Wilcox To: Dave Chinner Cc: Jan Kara , Amir Goldstein , lsf-pc@lists.linux-foundation.org, linux-fsdevel , linux-xfs , "Darrick J. Wong" , Christoph Hellwig Subject: Re: [LSF/MM TOPIC] Lazy file reflink Message-ID: <20190131211351.GB26359@bombadil.infradead.org> References: <20190128125044.GC27972@quack2.suse.cz> <20190128212642.GQ4205@dastard> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190128212642.GQ4205@dastard> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Tue, Jan 29, 2019 at 08:26:43AM +1100, Dave Chinner wrote: > Really, though, for this use case it's make more sense to have "per > file freeze" semantics. i.e. if you want a consistent backup image > on snapshot capable storage, the process is usually "freeze > filesystem, snapshot fs, unfreeze fs, do backup from snapshot, > remove snapshot". We can already transparently block incoming > writes/modifications on files via the freeze mechanism, so why not > just extend that to per-file granularity so writes to the "very > large read-mostly file" block while it's being backed up.... > > Indeed, this would probably only require a simple extension to > FIFREEZE/FITHAW - the parameter is currently ignored, but as defined > by XFS it was a "freeze level". Set this to 0xffffffff and then it > freezes just the fd passed in, not the whole filesystem. > Alternatively, FI_FREEZE_FILE/FI_THAW_FILE is simple to define... This sounds like you want a lease (aka oplock), which we already have implemented.