lkml.org 
[lkml]   [2010]   [Jun]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 1/5] fsfreeze: Prevent emergency thaw from looping infinitely
    Date
    From: Dave Chinner <dchinner@redhat.com>

    The thawing of a filesystem through sysrq-j loops infinitely as it
    incorrectly detects a thawed filesytsem as frozen and tries to
    unfreeze repeatedly. This is a regression caused by
    4504230a71566785a05d3e6b53fa1ee071b864eb ("freeze_bdev: grab active
    reference to frozen superblocks") in that it no longer returned
    -EINVAL for superblocks that were not frozen.

    Return -EINVAL when the filesystem is already unfrozen to avoid this
    problem.

    Signed-off-by: Dave Chinner <dchinner@redhat.com>
    ---
    fs/block_dev.c | 13 +++++--------
    1 files changed, 5 insertions(+), 8 deletions(-)

    diff --git a/fs/block_dev.c b/fs/block_dev.c
    index 7346c96..366ac38 100644
    --- a/fs/block_dev.c
    +++ b/fs/block_dev.c
    @@ -276,22 +276,19 @@ int thaw_bdev(struct block_device *bdev, struct super_block *sb)
    if (!bdev->bd_fsfreeze_count)
    goto out;

    - error = 0;
    - if (--bdev->bd_fsfreeze_count > 0)
    + if (!sb)
    goto out;

    - if (!sb)
    + error = 0;
    + if (--bdev->bd_fsfreeze_count > 0)
    goto out;

    error = thaw_super(sb);
    - if (error) {
    + if (error)
    bdev->bd_fsfreeze_count++;
    - mutex_unlock(&bdev->bd_fsfreeze_mutex);
    - return error;
    - }
    out:
    mutex_unlock(&bdev->bd_fsfreeze_mutex);
    - return 0;
    + return error;
    }
    EXPORT_SYMBOL(thaw_bdev);

    --
    1.7.1


    \
     
     \ /
      Last update: 2010-06-10 09:23    [W:0.021 / U:0.084 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site