Re: [PATCH 04/16] udf: check if udf_load_logicalvol failed

From: Jan Kara
Date: Thu Jan 10 2008 - 18:04:30 EST


On Thu 10-01-08 23:06:20, marcin.slusarz@xxxxxxxxx wrote:
> udf_load_logicalvol may fail eg in out of memory conditions - check it
> and propagate error further
>
> Signed-off-by: Marcin Slusarz <marcin.slusarz@xxxxxxxxx>
> CC: Ben Fennema <bfennema@xxxxxxxxxxxxxxxxxxxxxx>
> CC: Jan Kara <jack@xxxxxxx>
> CC: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Acked-by: Jan Kara <jack@xxxxxxx>

> ---
> fs/udf/super.c | 5 ++++-
> 1 files changed, 4 insertions(+), 1 deletions(-)
>
> diff --git a/fs/udf/super.c b/fs/udf/super.c
> index 3f5b632..9257796 100644
> --- a/fs/udf/super.c
> +++ b/fs/udf/super.c
> @@ -1263,7 +1263,10 @@ 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 */
> + if (udf_load_logicalvol(sb, bh, fileset)) {
> + brelse(bh);
> + return 1;
> + }
> } else if (i == VDS_POS_PARTITION_DESC) {
> struct buffer_head *bh2 = NULL;
> if (udf_load_partdesc(sb, bh)) {
> --
> 1.5.3.7
>

Honza
--
Jan Kara <jack@xxxxxxx>
SUSE Labs, CR
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/