From e8ea3db8011e13626bdcd96e55332c30447cc357 Mon Sep 17 00:00:00 2001 From: Li Zefan Date: Sun, 11 Sep 2011 10:52:25 -0400 Subject: [PATCH] --- yaml --- r: 263740 b: refs/heads/master c: d525e8ab022cb000e6e31a515ba8c3cf0d9c6130 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/btrfs/ioctl.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 79800a3b7a11..528318137a70 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: d72c0842ff0e71342857723bb65f35b71f57b264 +refs/heads/master: d525e8ab022cb000e6e31a515ba8c3cf0d9c6130 diff --git a/trunk/fs/btrfs/ioctl.c b/trunk/fs/btrfs/ioctl.c index 028a4b8c12cd..63b4de1626d2 100644 --- a/trunk/fs/btrfs/ioctl.c +++ b/trunk/fs/btrfs/ioctl.c @@ -2228,6 +2228,12 @@ static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd, !IS_ALIGNED(destoff, bs)) goto out_unlock; + if (destoff > inode->i_size) { + ret = btrfs_cont_expand(inode, inode->i_size, destoff); + if (ret) + goto out_unlock; + } + /* do any pending delalloc/csum calc on src, one way or another, and lock file content */ while (1) {