From: Josef Bacik <jbacik@fusionio.com>
To: Miao Xie <miaox@cn.fujitsu.com>
Cc: Linux Btrfs <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH V4 07/12] Btrfs: fix corrupted metadata in the snapshot
Date: Thu, 6 Sep 2012 09:09:14 -0400 [thread overview]
Message-ID: <20120906130914.GA18438@localhost.localdomain> (raw)
In-Reply-To: <504874D8.60001@cn.fujitsu.com>
On Thu, Sep 06, 2012 at 04:03:04AM -0600, Miao Xie wrote:
> When we delete a inode, we will remove all the delayed items including delayed
> inode update, and then truncate all the relative metadata. If there is lots of
> metadata, we will end the current transaction, and start a new transaction to
> truncate the left metadata. In this way, we will leave a inode item that its
> link counter is > 0, and also may leave some directory index items in fs/file tree
> after the current transaction ends. In other words, the metadata in this fs/file tree
> is inconsistent. If we create a snapshot for this tree now, we will find a inode with
> corrupted metadata in the new snapshot, and we won't continue to drop the left metadata,
> because its link counter is not 0.
>
> We fix this problem by updating the inode item before the current transaction ends.
>
> Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
> ---
> Changelog v1 -> v4:
> - Update the comment of the truncation in the btrfs_evict_inode()
> - Fix enospc problem of the inode update
This isn't the right way to do the enospc fix, we need to do
btrfs_start_transaction(root, 1); and then change the trans->block_rsv to our
reserve for the truncate and then set it back to the trans rsv for the update
that way we don't run out of space because we used our reservation for the
truncate. Just update this patch and send it along and I'll include it.
Thanks,
Josef
next prev parent reply other threads:[~2012-09-06 13:09 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-06 10:00 [PATCH V4 0/12] random bug fixes Miao Xie
2012-09-06 10:00 ` [PATCH V4 01/12] Btrfs: fix error path in create_pending_snapshot() Miao Xie
2012-09-17 16:56 ` David Sterba
2012-09-18 1:47 ` Miao Xie
2012-09-06 10:00 ` [PATCH V4 02/12] Btrfs: fix full backref problem when inserting shared block reference Miao Xie
2012-09-06 10:01 ` [PATCH V4 03/12] Btrfs: fix file extent discount problem in the, snapshot Miao Xie
2012-09-06 10:01 ` [PATCH V4 04/12] Btrfs: use a slab for ordered extents allocation Miao Xie
2012-09-06 10:02 ` [PATCH V4 05/12] Btrfs: fix wrong orphan count of the fs/file tree Miao Xie
2012-09-06 10:02 ` [PATCH V4 06/12] Btrfs: add a new "type" field into the block reservation structure Miao Xie
2012-09-06 10:03 ` [PATCH V4 07/12] Btrfs: fix corrupted metadata in the snapshot Miao Xie
2012-09-06 13:09 ` Josef Bacik [this message]
2012-09-07 3:10 ` Miao Xie
2012-09-07 7:43 ` [PATCH V5 " Miao Xie
2012-09-06 10:03 ` [PATCH V4 08/12] Btrfs: fix the snapshot that should not exist Miao Xie
2012-09-06 10:03 ` [PATCH V4 09/12] Btrfs: fix wrong size for the reservation of the, snapshot creation Miao Xie
2012-09-06 10:04 ` [PATCH V4 10/12] Btrfs: fix unprotected ->log_batch Miao Xie
2012-09-06 10:04 ` [PATCH V4 11/12] Btrfs: output more information when aborting a unused transaction handle Miao Xie
2012-09-06 10:04 ` [PATCH V4 12/12] Btrfs: fix wrong size for the reservation when doing, file pre-allocation Miao Xie
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=20120906130914.GA18438@localhost.localdomain \
--to=jbacik@fusionio.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=miaox@cn.fujitsu.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).