All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] pstore: return error code (if any) from efi_pstore_write
@ 2017-03-13 12:46 Kalugin, Evgeny
       [not found] ` <1489416765.32205.14.camel-HiM4UUiQNY10sU3rIFUpn1DQ4js95KgL@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Kalugin, Evgeny @ 2017-03-13 12:46 UTC (permalink / raw)
  To: keescook-F7+t8E8rja9g9hUCZPvPmw, ccross-z5hGa2qSFaRBDgjK7y7TUQ,
	Luck, Tony, linux-efi-u79uwXL29TY76Z2rM5mHXA,
	anton-9xeibp6oKSgdnm+yROfE0A

From 655a261d71af9de62e0e23ae0eb6f75037ae5e3e Mon Sep 17 00:00:00 2001
From: Evgeny Kalugin <evgeny.kalugin@intel.com>
Date: Tue, 7 Mar 2017 14:22:25 +0000
Subject: [PATCH] pstore: return error code (if any) from efi_pstore_write

For some reason return value from actual variable setting was ignored.
With this change error code get transferred upwards through call stack.

Signed-off-by: Evgeny Kalugin <evgeny.kalugin@intel.com>
---
 drivers/firmware/efi/efi-pstore.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/firmware/efi/efi-pstore.c b/drivers/firmware/efi/efi-pstore.c
index f402ba2..2ea808e 100644
--- a/drivers/firmware/efi/efi-pstore.c
+++ b/drivers/firmware/efi/efi-pstore.c
@@ -274,7 +274,7 @@ static int efi_pstore_write(enum pstore_type_id type,
 	for (i = 0; i < DUMP_NAME_LEN; i++)
 		efi_name[i] = name[i];
 
-	efivar_entry_set_safe(efi_name, vendor, PSTORE_EFI_ATTRIBUTES,
+	ret = efivar_entry_set_safe(efi_name, vendor, PSTORE_EFI_ATTRIBUTES,
 			      !pstore_cannot_block_path(reason),
 			      size, psi->buf);
 
-- 
1.9.1

---------------------------------------------------------------------
Intel Finland Oy
Registered Address: PL 281, 00181 Helsinki 
Business Identity Code: 0357606 - 4 
Domiciled in Helsinki 

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

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

* Re: [PATCH] pstore: return error code (if any) from efi_pstore_write
       [not found] ` <1489416765.32205.14.camel-HiM4UUiQNY10sU3rIFUpn1DQ4js95KgL@public.gmane.org>
@ 2017-03-14  8:24   ` Ard Biesheuvel
       [not found]     ` <CAKv+Gu92Lq62aJF4Ki2DU577xs09JWPLaOfRENRo=+VSyEBhVQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Ard Biesheuvel @ 2017-03-14  8:24 UTC (permalink / raw)
  To: Kalugin, Evgeny
  Cc: keescook-F7+t8E8rja9g9hUCZPvPmw, ccross-z5hGa2qSFaRBDgjK7y7TUQ,
	Luck, Tony, linux-efi-u79uwXL29TY76Z2rM5mHXA,
	anton-9xeibp6oKSgdnm+yROfE0A

On 13 March 2017 at 12:46, Kalugin, Evgeny <evgeny.kalugin-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> wrote:
> From 655a261d71af9de62e0e23ae0eb6f75037ae5e3e Mon Sep 17 00:00:00 2001
> From: Evgeny Kalugin <evgeny.kalugin-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> Date: Tue, 7 Mar 2017 14:22:25 +0000
> Subject: [PATCH] pstore: return error code (if any) from efi_pstore_write
>
> For some reason return value from actual variable setting was ignored.
> With this change error code get transferred upwards through call stack.
>
> Signed-off-by: Evgeny Kalugin <evgeny.kalugin-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

Thanks for the patch.

Could you give a bit more detail on how this broke things for you?

> ---
>  drivers/firmware/efi/efi-pstore.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/firmware/efi/efi-pstore.c b/drivers/firmware/efi/efi-pstore.c
> index f402ba2..2ea808e 100644
> --- a/drivers/firmware/efi/efi-pstore.c
> +++ b/drivers/firmware/efi/efi-pstore.c
> @@ -274,7 +274,7 @@ static int efi_pstore_write(enum pstore_type_id type,
>         for (i = 0; i < DUMP_NAME_LEN; i++)
>                 efi_name[i] = name[i];
>
> -       efivar_entry_set_safe(efi_name, vendor, PSTORE_EFI_ATTRIBUTES,
> +       ret = efivar_entry_set_safe(efi_name, vendor, PSTORE_EFI_ATTRIBUTES,
>                               !pstore_cannot_block_path(reason),
>                               size, psi->buf);
>
> --
> 1.9.1
>
> ---------------------------------------------------------------------
> Intel Finland Oy
> Registered Address: PL 281, 00181 Helsinki
> Business Identity Code: 0357606 - 4
> Domiciled in Helsinki
>
> This e-mail and any attachments may contain confidential material for
> the sole use of the intended recipient(s). Any review or distribution
> by others is strictly prohibited. If you are not the intended
> recipient, please contact the sender and delete all copies.

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

* Re: [PATCH] pstore: return error code (if any) from efi_pstore_write
       [not found]     ` <CAKv+Gu92Lq62aJF4Ki2DU577xs09JWPLaOfRENRo=+VSyEBhVQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2017-03-14  9:59       ` Kalugin, Evgeny
       [not found]         ` <1489493144.11640.29.camel-HiM4UUiQNY10sU3rIFUpn1DQ4js95KgL@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Kalugin, Evgeny @ 2017-03-14  9:59 UTC (permalink / raw)
  To: ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A
  Cc: keescook-F7+t8E8rja9g9hUCZPvPmw, ccross-z5hGa2qSFaRBDgjK7y7TUQ,
	Luck, Tony, linux-efi-u79uwXL29TY76Z2rM5mHXA,
	anton-9xeibp6oKSgdnm+yROfE0A

On Tue, 2017-03-14 at 08:24 +0000, Ard Biesheuvel wrote:
> On 13 March 2017 at 12:46, Kalugin, Evgeny <evgeny.kalugin@intel.com> wrote:
> > From 655a261d71af9de62e0e23ae0eb6f75037ae5e3e Mon Sep 17 00:00:00 2001
> > From: Evgeny Kalugin <evgeny.kalugin@intel.com>
> > Date: Tue, 7 Mar 2017 14:22:25 +0000
> > Subject: [PATCH] pstore: return error code (if any) from efi_pstore_write
> >
> > For some reason return value from actual variable setting was ignored.
> > With this change error code get transferred upwards through call stack.
> >
> > Signed-off-by: Evgeny Kalugin <evgeny.kalugin@intel.com>
> 
> Thanks for the patch.
> 
> Could you give a bit more detail on how this broke things for you?

Well, it haven't broken much things for me yet. I just found it when
tried to debug one problem in efi-pstore. There I was about to watch
return value from write call, when noticed that it is always zero and
that has not so much sense obviously.

> 
> > ---
> >  drivers/firmware/efi/efi-pstore.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/firmware/efi/efi-pstore.c b/drivers/firmware/efi/efi-pstore.c
> > index f402ba2..2ea808e 100644
> > --- a/drivers/firmware/efi/efi-pstore.c
> > +++ b/drivers/firmware/efi/efi-pstore.c
> > @@ -274,7 +274,7 @@ static int efi_pstore_write(enum pstore_type_id type,
> >         for (i = 0; i < DUMP_NAME_LEN; i++)
> >                 efi_name[i] = name[i];
> >
> > -       efivar_entry_set_safe(efi_name, vendor, PSTORE_EFI_ATTRIBUTES,
> > +       ret = efivar_entry_set_safe(efi_name, vendor, PSTORE_EFI_ATTRIBUTES,
> >                               !pstore_cannot_block_path(reason),
> >                               size, psi->buf);
> >
> > --
> > 1.9.1
> >


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

* Re: [PATCH] pstore: return error code (if any) from efi_pstore_write
       [not found]         ` <1489493144.11640.29.camel-HiM4UUiQNY10sU3rIFUpn1DQ4js95KgL@public.gmane.org>
@ 2017-03-17 22:52           ` Ard Biesheuvel
  0 siblings, 0 replies; 4+ messages in thread
From: Ard Biesheuvel @ 2017-03-17 22:52 UTC (permalink / raw)
  To: Kalugin, Evgeny
  Cc: keescook-F7+t8E8rja9g9hUCZPvPmw, ccross-z5hGa2qSFaRBDgjK7y7TUQ,
	Luck, Tony, linux-efi-u79uwXL29TY76Z2rM5mHXA,
	anton-9xeibp6oKSgdnm+yROfE0A

On 14 March 2017 at 09:59, Kalugin, Evgeny <evgeny.kalugin-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> wrote:
> On Tue, 2017-03-14 at 08:24 +0000, Ard Biesheuvel wrote:
>> On 13 March 2017 at 12:46, Kalugin, Evgeny <evgeny.kalugin-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> wrote:
>> > From 655a261d71af9de62e0e23ae0eb6f75037ae5e3e Mon Sep 17 00:00:00 2001
>> > From: Evgeny Kalugin <evgeny.kalugin-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
>> > Date: Tue, 7 Mar 2017 14:22:25 +0000
>> > Subject: [PATCH] pstore: return error code (if any) from efi_pstore_write
>> >
>> > For some reason return value from actual variable setting was ignored.
>> > With this change error code get transferred upwards through call stack.
>> >
>> > Signed-off-by: Evgeny Kalugin <evgeny.kalugin-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
>>
>> Thanks for the patch.
>>
>> Could you give a bit more detail on how this broke things for you?
>
> Well, it haven't broken much things for me yet. I just found it when
> tried to debug one problem in efi-pstore. There I was about to watch
> return value from write call, when noticed that it is always zero and
> that has not so much sense obviously.
>

Queued for v4.12, thanks

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

end of thread, other threads:[~2017-03-17 22:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-13 12:46 [PATCH] pstore: return error code (if any) from efi_pstore_write Kalugin, Evgeny
     [not found] ` <1489416765.32205.14.camel-HiM4UUiQNY10sU3rIFUpn1DQ4js95KgL@public.gmane.org>
2017-03-14  8:24   ` Ard Biesheuvel
     [not found]     ` <CAKv+Gu92Lq62aJF4Ki2DU577xs09JWPLaOfRENRo=+VSyEBhVQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-03-14  9:59       ` Kalugin, Evgeny
     [not found]         ` <1489493144.11640.29.camel-HiM4UUiQNY10sU3rIFUpn1DQ4js95KgL@public.gmane.org>
2017-03-17 22:52           ` Ard Biesheuvel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.