]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: send, fix corrupted path strings for long paths
authorFilipe Manana <fdmanana@gmail.com>
Wed, 21 May 2014 16:38:13 +0000 (17:38 +0100)
committerChris Mason <clm@fb.com>
Fri, 6 Jun 2014 19:00:46 +0000 (12:00 -0700)
commit87f626c25dc7b083b5097670798e36f8ca61ecf3
treeb824de5fffb1f0acccc79de5575b47d6298f97ec
parent0fc60f1eebdc2d0b59fc98f91cb2e7968a7fb0ce
Btrfs: send, fix corrupted path strings for long paths

If a path has more than 230 characters, we allocate a new buffer to
use for the path, but we were forgotting to copy the contents of the
previous buffer into the new one, which has random content from the
kmalloc call.

Test:

    mkfs.btrfs -f /dev/sdd
    mount /dev/sdd /mnt

    TEST_PATH="/mnt/fdmanana/.config/google-chrome-mysetup/Default/Pepper_Data/Shockwave_Flash/WritableRoot/#SharedObjects/JSHJ4ZKN/s.wsj.net/[[IMPORT]]/players.edgesuite.net/flash/plugins/osmf/advanced-streaming-plugin/v2.7/osmf1.6/Ak#"
    mkdir -p $TEST_PATH
    echo "hello world" > $TEST_PATH/amaiAdvancedStreamingPlugin.txt

    btrfs subvolume snapshot -r /mnt /mnt/mysnap1
    btrfs send /mnt/mysnap1 -f /tmp/1.snap

A test for xfstests follows.

Signed-off-by: Filipe David Borba Manana <fdmanana@gmail.com>
Cc: Marc Merlin <marc@merlins.org>
Tested-by: Marc MERLIN <marc@merlins.org>
Signed-off-by: Chris Mason <clm@fb.com>
fs/btrfs/send.c