public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Daniel J Blueman <daniel.blueman@gmail.com>
To: Sage Weil <sage@newdream.net>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: user transactions and ENOSPC...
Date: Sat, 26 Sep 2009 15:08:10 +0100	[thread overview]
Message-ID: <6278d2220909260708w49d8b948t72a4bd4eefc88d31@mail.gmail.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0909251405560.9827@cobra.newdream.net>

On Fri, Sep 25, 2009 at 10:10 PM, Sage Weil <sage@newdream.net> wrote:
> So, the btrfs user transaction ioctls work like so
>
> =A0ioctl(fd, BTRFS_IOC_TRANS_START);
> =A0/* do many operations: write(), setxattr(), rmdir(), whatever. */
> =A0ioctl(fd, BTRFS_IOC_TRANS_END); =A0 =A0/* or close(fd); */
=2E..
> The second problem is that the application may die between START and
> END. The current ioctls are "safe" in that the transaction handle is
> closed when the struct file is released, so the fs won't get wedged i=
f
> you say segfault. =A0On the other hand, they're "unsafe" in that a pr=
ocess
> that is killed or segfaults will result in an imcomplete transaction
> making it to disk, which leaves the file system in an inconsistent st=
ate
> (from the point of view of the application).

With COW, where a transaction is incomplete due to application exit
without closing the transaction, is there a way to drop the
reference/'deallocate' the new tree nodes, thus moving back to the
prior state? Presumably the new tree nodes would get linked in when
the transaction is closed.
--=20
Daniel J Blueman
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" =
in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2009-09-26 14:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-25 21:10 user transactions and ENOSPC Sage Weil
2009-09-26 14:08 ` Daniel J Blueman [this message]
2009-09-28 16:05   ` Sage Weil
2009-10-07 21:58 ` Valerie Aurora
2009-10-08  4:07   ` 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=6278d2220909260708w49d8b948t72a4bd4eefc88d31@mail.gmail.com \
    --to=daniel.blueman@gmail.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=sage@newdream.net \
    /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