Btrfs: fix error path in create_pending_snapshot()
authorMiao Xie <miaox@cn.fujitsu.com>
Thu, 6 Sep 2012 10:00:32 +0000 (04:00 -0600)
committerChris Mason <chris.mason@fusionio.com>
Mon, 1 Oct 2012 19:19:09 +0000 (15:19 -0400)
commit6fa9700e734275de2acbcb0e99414bd7ddfc60f1
tree97c65df04e339c42b0255d1058f9ef2c73ec857a
parentcf93dccea67ad8f5e0d9163c6a0a584550bbd7cd
Btrfs: fix error path in create_pending_snapshot()

This patch fixes the following problem:
- If we failed to deal with the delayed dir items, we should abort transaction,
  just as its comment said. Fix it.
- If root reference or root back reference insertion failed, we should
  abort transaction. Fix it.
- Fix the double free problem of pending->inherit.
- Do not restore the trans->rsv if we doesn't change it.
- make the error path more clearly.

Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
fs/btrfs/transaction.c