diff options
author | Yan Zheng <zheng.yan@oracle.com> | 2009-01-05 20:43:43 (GMT) |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2009-01-05 20:43:43 (GMT) |
commit | 52c2617990fed072220708d6b771dc10f37547b0 (patch) | |
tree | 6f97a07b56927bc96fabb0669cd31d0d0d28273a /fs/btrfs/ioctl.c | |
parent | e441d54de4fd97dd381f3e73636f5ba51ff4c7d9 (diff) | |
download | linux-fsl-qoriq-52c2617990fed072220708d6b771dc10f37547b0.tar.xz |
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 'fs/btrfs/ioctl.c')
-rw-r--r-- | fs/btrfs/ioctl.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 150784e..ba484aa 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -147,6 +147,10 @@ static noinline int create_subvol(struct btrfs_root *root, if (ret) goto fail; + btrfs_i_size_write(dir, dir->i_size + namelen * 2); + ret = btrfs_update_inode(trans, root, dir); + BUG_ON(ret); + /* add the backref first */ ret = btrfs_add_root_ref(trans, root->fs_info->tree_root, objectid, BTRFS_ROOT_BACKREF_KEY, |