From owner-freebsd-fs@FreeBSD.ORG Mon Dec 15 19:55:41 2008 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E1EA3106564A for ; Mon, 15 Dec 2008 19:55:41 +0000 (UTC) (envelope-from zbeeble@gmail.com) Received: from yx-out-2324.google.com (yx-out-2324.google.com [74.125.44.29]) by mx1.freebsd.org (Postfix) with ESMTP id 95B6D8FC13 for ; Mon, 15 Dec 2008 19:55:41 +0000 (UTC) (envelope-from zbeeble@gmail.com) Received: by yx-out-2324.google.com with SMTP id 8so1322388yxb.13 for ; Mon, 15 Dec 2008 11:55:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type:references; bh=9ttu1cbQsUjVRnHj1AhhMnmtiH0uD16urCiBQ4vCSWQ=; b=vT1G+Da0iScY1CtKEgrPd2nVgHheao5KulNKmb1fVRdvRJJHqgt9MCxwsL3XGT+OiW Mfk/e/yb6EWD76rKvdFzUgd1tQzwiQNp0MobNWuLoiVEyzT4AeAaEAoKpSOj8hf6fFkW d7epwP+GsjkBNUKdxXNJ8FwwFimQ4DxWhSUEU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:references; b=FBCR2s9M4iGYQj8Z9fJF2auJMDbgFALmCTO58e3KdT2IYn224kRDPmmmUrrPgmz/gn 4YTJP9tVRF/mvv1eAiDx18exGWsGWyuVXgStSqdWl2G+LcR5UiZPhncacNq+AAy3KHre dR/GaTUHBrvWTOPI2FbU9F1Fp3+96xZdQUTqU= Received: by 10.151.13.7 with SMTP id q7mr3976362ybi.180.1229370940893; Mon, 15 Dec 2008 11:55:40 -0800 (PST) Received: by 10.151.130.10 with HTTP; Mon, 15 Dec 2008 11:55:40 -0800 (PST) Message-ID: <5f67a8c40812151155o166b96b1meef07e685307c9ba@mail.gmail.com> Date: Mon, 15 Dec 2008 14:55:40 -0500 From: "Zaphod Beeblebrox" To: "Christopher Arnold" In-Reply-To: MIME-Version: 1.0 References: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-fs@freebsd.org Subject: Re: ZFS and other filesystem semantics. X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2008 19:55:42 -0000 On Tue, Dec 9, 2008 at 9:01 AM, Christopher Arnold wrote: > i have been thinking a bit about filesytem semantics lately. Mainly about > open files. > > Classicly if a file is open the filedescriptor continues accessing the same > file regardless if it is deleted or someone did a mv and replaced it. > > But what happens in ZFS? > > * delete file in ZFS > I guess this is a no brainer, standard unix way of accessing the old file. When all references to data are freed, the data is freed. directory entries and open files are both references. > * The fs get snapshotted and file deleted > Same as above i guess. A snapshot counts as a reference > * The fs gets snapshotted and later the snapshot get deleted... > What happens here? A snapshot is a reference. When the file is "deleted" the snapshot still references the data. When the snapshot is deleted, if the data has no other references, it is freed. > Or maybe even: > * The fs gets snapshotted, file deleted, then snapshot deleted. > > (These questions are actually just a sidestep from the issue im trying to > figure out right no. But i guess they are nevertheless interesting.) > > The reason i have been thinking about this is that i'm implementing a > remote RO filesystem with local caching. And to reduce latency i download > chunks of the files and cache these chunks. I'm trying to keep the > filesystem stateless, but my issue is that if the file get changed under our > feet the resulting chunks would be from different files. > > Have anyone seen a nice solution to this issue? > > Does anyone have any ideas of how to implement unix like semantics over a > stateless procotol without to much magic? The semantics you desire are basically reference counting.