lkml.org 
[lkml]   [2007]   [Dec]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Subject[PATCH 4/6] udf: check if udf_load_logicalvol failed
    Date
    From
    udf_load_logicalvol may fail eg in out of memory conditions - check it
    and propagate error further

    Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
    CC: Ben Fennema <bfennema@falcon.csc.calpoly.edu>
    CC: Jan Kara <jack@suse.cz>
    CC: Christoph Hellwig <hch@infradead.org>
    ---
    fs/udf/super.c | 7 ++++++-
    1 files changed, 6 insertions(+), 1 deletions(-)

    diff --git a/fs/udf/super.c b/fs/udf/super.c
    index 0ea34c5..f138309 100644
    --- a/fs/udf/super.c
    +++ b/fs/udf/super.c
    @@ -1183,6 +1183,7 @@ static int udf_process_sequence(struct super_block *sb, long block,
    uint32_t vdsn;
    uint16_t ident;
    long next_s = 0, next_e = 0;
    + int ret;

    memset(vds, 0, sizeof(struct udf_vds_record) * VDS_POS_LENGTH);

    @@ -1258,7 +1259,11 @@ static int udf_process_sequence(struct super_block *sb, long block,
    if (i == VDS_POS_PRIMARY_VOL_DESC) {
    udf_load_pvoldesc(sb, bh);
    } else if (i == VDS_POS_LOGICAL_VOL_DESC) {
    - udf_load_logicalvol(sb, bh, fileset); /* TODO: check return value */
    + ret = udf_load_logicalvol(sb, bh, fileset);
    + if (ret != 0) {
    + brelse(bh);
    + return ret;
    + }
    } else if (i == VDS_POS_PARTITION_DESC) {
    struct buffer_head *bh2 = NULL;
    if (udf_load_partdesc(sb, bh)) {
    --
    1.5.3.4


    \
     
     \ /
      Last update: 2007-12-24 01:13    [W:0.020 / U:153.284 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site