]> git.hungrycats.org Git - linux/commitdiff
Btrfs: fix uninit variable in clone ioctl
authorChris Mason <clm@fb.com>
Sat, 11 Apr 2015 12:09:06 +0000 (05:09 -0700)
committerZygo Blaxell <zblaxell@serenity.furryterror.org>
Fri, 17 Apr 2015 15:59:46 +0000 (11:59 -0400)
Commit 0d97a64e0 creates a new variable but doesn't always set it up.
This puts it back to the original method (key.offset + 1) for the cases
not covered by Filipe's new logic.

Signed-off-by: Chris Mason <clm@fb.com>
(cherry picked from commit de249e66a73d696666281cd812087979c6fae552)

fs/btrfs/ioctl.c

index 6b8b7627207c45391bd894dcc13392399575a915..52f834a132ae733241eb3a9c5e4ee26b87e2de3a 100644 (file)
@@ -3233,7 +3233,7 @@ static int btrfs_clone(struct inode *src, struct inode *inode,
        key.offset = off;
 
        while (1) {
-               u64 next_key_min_offset;
+               u64 next_key_min_offset = key.offset + 1;
 
                /*
                 * note the key will change type as we walk through the