lkml.org 
[lkml]   [2012]   [May]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 2/6] pstore/ram: Add console messages handling
From
On Wed, May 16, 2012 at 5:56 AM, Anton Vorontsov
<anton.vorontsov@linaro.org> wrote:
> This is all straightforward: we just use the last region for
> console logging. If there's just one region, we fall-back to
> the old behaviour: just a oops/dumps logging.
>
> Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
> ---
>  fs/pstore/ram.c |   39 ++++++++++++++++++++++++++++++---------
>  1 file changed, 30 insertions(+), 9 deletions(-)
>
> diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c
> index 9123cce..54213eb 100644
> --- a/fs/pstore/ram.c
> +++ b/fs/pstore/ram.c
> [...]
> @@ -142,7 +148,12 @@ static int ramoops_pstore_write(enum pstore_type_id type,
>        struct persistent_ram_zone *prz = cxt->przs[cxt->count];
>        size_t hlen;
>
> -       /* Currently ramoops is designed to only store dmesg dumps. */
> +       if (type == PSTORE_TYPE_CONSOLE) {
> +               if (!cxt->cprz)
> +                       return -ENOMEM;
> +               persistent_ram_write(cxt->cprz, cxt->pstore.buf, size);
> +       }
> +
>        if (type != PSTORE_TYPE_DMESG)
>                return -EINVAL;

Doesn't this mean that type == PSTORE_TYPE_CONSOLE will write to the
ram, but then fail with -EINVAL?

-Kees

--
Kees Cook
Chrome OS Security
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2012-05-16 19:21    [W:0.194 / U:0.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site