lkml.org 
[lkml]   [2008]   [Dec]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[patch 082/104] ext4: add missing unlock in ext4_check_descriptors() on error path

    2.6.27-stable review patch. If anyone has any objections, please let us know.

    ------------------
    From: Li Zefan <lizf@cn.fujitsu.com>

    (cherry picked from commit 7ee1ec4ca30c6df8e989615cdaacb75f2af4fa6b)

    If there group descriptors are corrupted we need unlock the block
    group lock before returning from the function; else we will oops when
    freeing a spinlock which is still being held.

    Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
    Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

    ---
    fs/ext4/super.c | 4 +++-
    1 file changed, 3 insertions(+), 1 deletion(-)

    --- a/fs/ext4/super.c
    +++ b/fs/ext4/super.c
    @@ -1626,8 +1626,10 @@ static int ext4_check_descriptors(struct
    "Checksum for group %lu failed (%u!=%u)\n",
    i, le16_to_cpu(ext4_group_desc_csum(sbi, i,
    gdp)), le16_to_cpu(gdp->bg_checksum));
    - if (!(sb->s_flags & MS_RDONLY))
    + if (!(sb->s_flags & MS_RDONLY)) {
    + spin_unlock(sb_bgl_lock(sbi, i));
    return 0;
    + }
    }
    spin_unlock(sb_bgl_lock(sbi, i));
    if (!flexbg_flag)


    \
     
     \ /
      Last update: 2008-12-03 21:27    [W:4.275 / U:0.124 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site