cp --reflink with Btrfs
diff mbox

Message ID Pine.LNX.4.64.0912160943280.2801@cobra.newdream.net
State New, archived
Headers show

Commit Message

Sage Weil Dec. 16, 2009, 5:55 p.m. UTC
None

Patch
diff mbox

diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index cdbb054..1a964a4 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -994,8 +994,11 @@  static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd,
 	}
 
 	/* determine range to clone */
+	ret = 0;
+	if (off == src->i_size && len == 0)
+		goto out_unlock;
 	ret = -EINVAL;
-	if (off >= src->i_size || off + len > src->i_size)
+	if (off > src->i_size || off + len > src->i_size)
 		goto out_unlock;
 	if (len == 0)
 		olen = len = src->i_size - off;