public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v2] UBIFS: Missing offset relocation for compressor 'none'
@ 2009-03-19  9:06 Michael Lawnick
  2009-03-20  7:31 ` Stefan Roese
  2009-03-20 21:13 ` Wolfgang Denk
  0 siblings, 2 replies; 5+ messages in thread
From: Michael Lawnick @ 2009-03-19  9:06 UTC (permalink / raw)
  To: u-boot

On systems where U-Boot is linked to another address than it really lays
(e.g. backup image), calls via function pointers must be fixed with a
'+= gd->reloc_off'.
This was not done for none_compr in ubifs_compressors_init() what leads
to system crash on ubifsmount command.

Signed-off-by: Michael Lawnick <ml.lawnick@gmx.de>
---
 fs/ubifs.c |    5 +-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff -Naur a/fs/ubifs/ubifs.c b/fs/ubifs/ubifs.c
--- a/fs/ubifs/ubifs.c 2009-02-20 16:02:44.434443000 +0100
+++ b/fs/ubifs/ubifs.c 2009-03-18 16:06:09.000000000 +0100

@@ -147,7 +147,10 @@ int __init ubifs_compressors_init(void)
        if (err)
                return err;

-       ubifs_compressors[UBIFS_COMPR_NONE] = &none_compr;
+       err = compr_init(&none_compr);
+       if (err)
+               return err;
+
        return 0;
 }
 --
Kind regards,
Michael
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot] [PATCH v2] UBIFS: Missing offset relocation for compressor 'none'
  2009-03-19  9:06 [U-Boot] [PATCH v2] UBIFS: Missing offset relocation for compressor 'none' Michael Lawnick
@ 2009-03-20  7:31 ` Stefan Roese
  2009-03-20 10:45   ` Detlev Zundel
  2009-03-20 21:13 ` Wolfgang Denk
  1 sibling, 1 reply; 5+ messages in thread
From: Stefan Roese @ 2009-03-20  7:31 UTC (permalink / raw)
  To: u-boot

On Thursday 19 March 2009, Michael Lawnick wrote:
> On systems where U-Boot is linked to another address than it really lays
> (e.g. backup image), calls via function pointers must be fixed with a
> '+= gd->reloc_off'.
> This was not done for none_compr in ubifs_compressors_init() what leads
> to system crash on ubifsmount command.
>
> Signed-off-by: Michael Lawnick <ml.lawnick@gmx.de>

Acked-by: Stefan Roese <sr@denx.de>

Please note that I explicitly didn't fold this patch into my latest UBIFS 
patch series. We should apply it after UBIFS is available in mainline so that 
Michael will be listed as author for this fix.

Thanks.

Best regards,
Stefan

=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot] [PATCH v2] UBIFS: Missing offset relocation for compressor 'none'
  2009-03-20  7:31 ` Stefan Roese
@ 2009-03-20 10:45   ` Detlev Zundel
  2009-03-20 10:51     ` Stefan Roese
  0 siblings, 1 reply; 5+ messages in thread
From: Detlev Zundel @ 2009-03-20 10:45 UTC (permalink / raw)
  To: u-boot

Hi Stefan,

> On Thursday 19 March 2009, Michael Lawnick wrote:
>> On systems where U-Boot is linked to another address than it really lays
>> (e.g. backup image), calls via function pointers must be fixed with a
>> '+= gd->reloc_off'.
>> This was not done for none_compr in ubifs_compressors_init() what leads
>> to system crash on ubifsmount command.
>>
>> Signed-off-by: Michael Lawnick <ml.lawnick@gmx.de>
>
> Acked-by: Stefan Roese <sr@denx.de>
>
> Please note that I explicitly didn't fold this patch into my latest UBIFS 
> patch series. We should apply it after UBIFS is available in mainline so that 
> Michael will be listed as author for this fix.

I was not so sure about this, so I was waiting for your opinion, but are
you sure that it is ok to remove the assignment?  Doesn't other code
depend on that?

@@ -147,7 +147,10 @@ int __init ubifs_compressors_init(void)
        if (err)
                return err;

-       ubifs_compressors[UBIFS_COMPR_NONE] = &none_compr;
+       err = compr_init(&none_compr);
+       if (err)
+               return err;
+
        return 0;
 }

Cheers
  Detlev

-- 
Narren sind alle, die es scheinen, und die Haelfte derer, die es nicht
scheinen ..  Jedoch ist der groesste Narr, wer es nicht zu sein glaubt
und alle andern dafuer erklaert.
                                    --- Baltasar Gracian
--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot] [PATCH v2] UBIFS: Missing offset relocation for compressor 'none'
  2009-03-20 10:45   ` Detlev Zundel
@ 2009-03-20 10:51     ` Stefan Roese
  0 siblings, 0 replies; 5+ messages in thread
From: Stefan Roese @ 2009-03-20 10:51 UTC (permalink / raw)
  To: u-boot

Hi Detlev,

On Friday 20 March 2009, Detlev Zundel wrote:
> > Please note that I explicitly didn't fold this patch into my latest UBIFS
> > patch series. We should apply it after UBIFS is available in mainline so
> > that Michael will be listed as author for this fix.
>
> I was not so sure about this, so I was waiting for your opinion, but are
> you sure that it is ok to remove the assignment?  Doesn't other code
> depend on that?
>
> @@ -147,7 +147,10 @@ int __init ubifs_compressors_init(void)
>         if (err)
>                 return err;
>
> -       ubifs_compressors[UBIFS_COMPR_NONE] = &none_compr;
> +       err = compr_init(&none_compr);
> +       if (err)
> +               return err;
> +
>         return 0;
>  }

Yes, I'm pretty sure this patch is correct. The removed assignment is done in 
compr_init() as well:

/**
 * compr_init - initialize a compressor.
 * @compr: compressor description object
 *
 * This function initializes the requested compressor and returns zero in case
 * of success or a negative error code in case of failure.
 */
static int __init compr_init(struct ubifs_compressor *compr)
{
	ubifs_compressors[compr->compr_type] = compr;
	ubifs_compressors[compr->compr_type]->name += gd->reloc_off;
	ubifs_compressors[compr->compr_type]->capi_name += gd->reloc_off;
	ubifs_compressors[compr->compr_type]->decompress += gd->reloc_off;
	return 0;
}

Best regards,
Stefan

=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot] [PATCH v2] UBIFS: Missing offset relocation for compressor 'none'
  2009-03-19  9:06 [U-Boot] [PATCH v2] UBIFS: Missing offset relocation for compressor 'none' Michael Lawnick
  2009-03-20  7:31 ` Stefan Roese
@ 2009-03-20 21:13 ` Wolfgang Denk
  1 sibling, 0 replies; 5+ messages in thread
From: Wolfgang Denk @ 2009-03-20 21:13 UTC (permalink / raw)
  To: u-boot

Dear Michael Lawnick,

In message <49C20B21.1080005@gmx.de> you wrote:
> On systems where U-Boot is linked to another address than it really lays
> (e.g. backup image), calls via function pointers must be fixed with a
> '+= gd->reloc_off'.
> This was not done for none_compr in ubifs_compressors_init() what leads
> to system crash on ubifsmount command.
> 
> Signed-off-by: Michael Lawnick <ml.lawnick@gmx.de>
> ---
>  fs/ubifs.c |    5 +-
>  1 files changed, 4 insertions(+), 1 deletions(-)
> 
> diff -Naur a/fs/ubifs/ubifs.c b/fs/ubifs/ubifs.c
> --- a/fs/ubifs/ubifs.c 2009-02-20 16:02:44.434443000 +0100
> +++ b/fs/ubifs/ubifs.c 2009-03-18 16:06:09.000000000 +0100
> 
> @@ -147,7 +147,10 @@ int __init ubifs_compressors_init(void)
>         if (err)
>                 return err;
> 
> -       ubifs_compressors[UBIFS_COMPR_NONE] = &none_compr;
> +       err = compr_init(&none_compr);
> +       if (err)
> +               return err;
> +
>         return 0;
>  }

Applied (with manual fixing) to "next" branch.

Please do not hand-edit your patches, resp. make sure to use
git-send-email to submit the poatches.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Motto of the Electrical Engineer: Working computer hardware is a  lot
like an erect penis: it stays up as long as you don't fuck with it.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-03-20 21:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-19  9:06 [U-Boot] [PATCH v2] UBIFS: Missing offset relocation for compressor 'none' Michael Lawnick
2009-03-20  7:31 ` Stefan Roese
2009-03-20 10:45   ` Detlev Zundel
2009-03-20 10:51     ` Stefan Roese
2009-03-20 21:13 ` Wolfgang Denk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox