summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/transaction.c
diff options
context:
space:
mode:
authorYan Zheng <zheng.yan@oracle.com>2009-01-05 21:43:43 +0100
committerChris Mason <chris.mason@oracle.com>2009-01-05 21:43:43 +0100
commit52c2617990fed072220708d6b771dc10f37547b0 (patch)
tree6f97a07b56927bc96fabb0669cd31d0d0d28273a /fs/btrfs/transaction.c
parentBtrfs: add permission checks to the ioctls (diff)
downloadlinux-52c2617990fed072220708d6b771dc10f37547b0.tar.xz
linux-52c2617990fed072220708d6b771dc10f37547b0.zip
Btrfs: update directory's size when creating subvol/snapshot
Make sure directory's size properly updated when creating subvol/snapshot. Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
Diffstat (limited to '')
-rw-r--r--fs/btrfs/transaction.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
index 4604178a43a9..4e7b56e9d3a5 100644
--- a/fs/btrfs/transaction.c
+++ b/fs/btrfs/transaction.c
@@ -819,6 +819,10 @@ static noinline int finish_pending_snapshot(struct btrfs_fs_info *fs_info,
if (ret)
goto fail;
+ btrfs_i_size_write(parent_inode, parent_inode->i_size + namelen * 2);
+ ret = btrfs_update_inode(trans, parent_root, parent_inode);
+ BUG_ON(ret);
+
/* add the backref first */
ret = btrfs_add_root_ref(trans, parent_root->fs_info->tree_root,
pending->root_key.objectid,