From: "Bron Gondwana" <brong@fastmail.fm>
To: "Chris Mason" <chris.mason@oracle.com>
Cc: "Evgeniy Polyakov" <johnpol@2ka.mipt.ru>,
btrfs-devel@oss.oracle.com, "Zach Brown" <zach.brown@oracle.com>,
linux-btrfs@vger.kernel.org
Subject: Re: [Btrfs-devel] transaction ioctls
Date: Sun, 27 Apr 2008 20:55:08 +1000 [thread overview]
Message-ID: <1209293708.20552.1250088137@webmail.messagingengine.com> (raw)
In-Reply-To: <200804240906.54788.chris.mason@oracle.com>
On Thu, 24 Apr 2008 09:06:54 -0400, "Chris Mason" <chris.mason@oracle.com> said:
> On Wednesday 23 April 2008, Bron Gondwana wrote:
> > On Wed, Apr 23, 2008 at 09:23:03AM -0400, Chris Mason wrote:
> > > proc A: mkdir dir1
> > > proc A: create dir1/file1
> > > proc B: add data to dir1/file1
> > > proc B: fsync dir1/file1
> > > proc A: rollback
> > >
> > > Filesystems can be databases, but not with the current APIs. Userland
> > > simply isn't built around these semantics today.
> >
> > proc A: mkdir dir1
> > proc A: create dir1/file1
> > proc B: add data to dir1/file1
> > proc B: fsync dir1/file1
> > proc A: unlink dir1/file1
> > proc A: rmdir dir1
> >
> > I don't see the difference.
>
> The main difference is that in the unlink case, the unlink goes through a
> series of code in the VFS to make sure that open file handles stay viable
> and that all of the other posix rules are followed. In the rollback case,
> the filesystem has to do all of that on its own.
>
> Here's another:
>
> proc A: mkdir dir1
> proc B: open dir1/file1 O_CREATE
> proc A: rollback
> proc B: close
>
> [... I've trimmed the following a bit, it's only partially quoted...]
>
> Doing the same thing with rmdir would fail because the directory wasn't
> empty. In order to provide the rollback, the FS would have to wander
> through all of the dentries and do something sane with them....
>
> The main point is this kind of thing is littered with corner cases.
> You'd have to find each file or directory affected by the rollback
> and make sure appropriate actions are taken for each one, and get
> it done in a VFS friendly deadlock free way.
Yeah, that's a good point. I suspect my first pass idea for this would
look remarkably like a soft-mounted NFS drive that had been disconnected.
Ooops, your little bit of filesystem went away - EIO, byebye.
Bron.
--
Bron Gondwana
brong@fastmail.fm
next prev parent reply other threads:[~2008-04-27 10:55 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <Pine.LNX.4.64.0804221210130.23551@cobra.newdream.net>
2008-04-22 20:29 ` [Btrfs-devel] transaction ioctls Zach Brown
2008-04-22 20:41 ` Chris Mason
2008-04-22 20:52 ` Sage Weil
2008-04-22 20:55 ` Chris Mason
2008-04-22 20:56 ` Sage Weil
2008-04-22 21:05 ` Evgeniy Polyakov
2008-04-23 12:50 ` Chris Mason
2008-04-23 12:57 ` Evgeniy Polyakov
2008-04-23 13:07 ` Chris Mason
2008-04-23 13:15 ` Evgeniy Polyakov
2008-04-23 13:23 ` Chris Mason
[not found] ` <200804230923.03752.chris.mason@oracle.com>
2008-04-23 16:21 ` Evgeniy Polyakov
2008-04-23 17:15 ` Chris Mason
2008-04-23 23:52 ` Bron Gondwana
2008-04-24 13:06 ` Chris Mason
[not found] ` <200804240906.54788.chris.mason@oracle.com>
2008-04-27 10:55 ` Bron Gondwana [this message]
2008-04-23 17:12 ` btrfs-devel
2008-04-22 20:32 ` Chris Mason
2008-04-22 20:48 ` Sage Weil
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1209293708.20552.1250088137@webmail.messagingengine.com \
--to=brong@fastmail.fm \
--cc=btrfs-devel@oss.oracle.com \
--cc=chris.mason@oracle.com \
--cc=johnpol@2ka.mipt.ru \
--cc=linux-btrfs@vger.kernel.org \
--cc=zach.brown@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).