mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Nikola Pajkovsky <npajkovs@redhat.com>
Cc: Jan Kara <jack@suse.cz>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] udf: fix retun value on error path in udf_load_logicalvol
Date: Wed, 15 Aug 2012 14:23:47 +0200	[thread overview]
Message-ID: <20120815122347.GC29223@quack.suse.cz> (raw)
In-Reply-To: <c50410075da9d2f4cd7ebb42fadf11a67dcfa175.1344983600.git.npajkovs@redhat.com>

On Wed 15-08-12 00:38:08, Nikola Pajkovsky wrote:
> In case we detect a problem and bail out, we fail to set "ret" to a
> nonzero value, and udf_load_logicalvol will mistakenly report success.
> 
> Signed-off-by: Nikola Pajkovsky <npajkovs@redhat.com>
  Thanks. I've added the patch to my tree and will send it to Linus soon.

								Honza

> ---
>  fs/udf/super.c |    5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/udf/super.c b/fs/udf/super.c
> index dcbf987..c96bd77 100644
> --- a/fs/udf/super.c
> +++ b/fs/udf/super.c
> @@ -1344,6 +1344,7 @@ static int udf_load_logicalvol(struct super_block *sb, sector_t block,
>  		udf_err(sb, "error loading logical volume descriptor: "
>  			"Partition table too long (%u > %lu)\n", table_len,
>  			sb->s_blocksize - sizeof(*lvd));
> +		ret = 1;
>  		goto out_bh;
>  	}
>  
> @@ -1388,8 +1389,10 @@ static int udf_load_logicalvol(struct super_block *sb, sector_t block,
>  						UDF_ID_SPARABLE,
>  						strlen(UDF_ID_SPARABLE))) {
>  				if (udf_load_sparable_map(sb, map,
> -				    (struct sparablePartitionMap *)gpm) < 0)
> +				    (struct sparablePartitionMap *)gpm) < 0) {
> +					ret = 1;
>  					goto out_bh;
> +				}
>  			} else if (!strncmp(upm2->partIdent.ident,
>  						UDF_ID_METADATA,
>  						strlen(UDF_ID_METADATA))) {
> -- 
> 1.7.10.2
> 
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

      reply	other threads:[~2012-08-15 12:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-14 22:38 Nikola Pajkovsky
2012-08-15 12:23 ` Jan Kara [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120815122347.GC29223@quack.suse.cz \
    --to=jack@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=npajkovs@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome