lkml.org 
[lkml]   [2013]   [Dec]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 3.10 070/173] dm array: fix bug in growing array
    Date
    3.10-stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Joe Thornber <ejt@redhat.com>

    commit 9c1d4de56066e4d6abc66ec188faafd7b303fb08 upstream.

    Entries would be lost if the old tail block was partially filled.

    Signed-off-by: Joe Thornber <ejt@redhat.com>
    Signed-off-by: Mike Snitzer <snitzer@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    ---
    drivers/md/persistent-data/dm-array.c | 5 ++++-
    1 file changed, 4 insertions(+), 1 deletion(-)

    --- a/drivers/md/persistent-data/dm-array.c
    +++ b/drivers/md/persistent-data/dm-array.c
    @@ -509,15 +509,18 @@ static int grow_add_tail_block(struct re
    static int grow_needs_more_blocks(struct resize *resize)
    {
    int r;
    + unsigned old_nr_blocks = resize->old_nr_full_blocks;

    if (resize->old_nr_entries_in_last_block > 0) {
    + old_nr_blocks++;
    +
    r = grow_extend_tail_block(resize, resize->max_entries);
    if (r)
    return r;
    }

    r = insert_full_ablocks(resize->info, resize->size_of_block,
    - resize->old_nr_full_blocks,
    + old_nr_blocks,
    resize->new_nr_full_blocks,
    resize->max_entries, resize->value,
    &resize->root);



    \
     
     \ /
      Last update: 2013-12-02 22:41    [W:2.803 / U:0.296 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site