Re: [PATCH 2/6] pstore/ram: Add console messages handling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, May 16, 2012 at 09:45:35AM -0700, Kees Cook wrote:
> On Wed, May 16, 2012 at 5:56 AM, Anton Vorontsov
> <anton.vorontsov@xxxxxxxxxx> 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@xxxxxxxxxx>
> > ---
> >  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?

Right you are, there should be 'return 0' for TYPE_CONSOLE. It is
harmless tho (and unnoticeable, since we can't check return value of
the ->write() calback and print error, since this would recurse),
but I'll surely amend that.

Thanks!

-- 
Anton Vorontsov
Email: cbouatmailru@xxxxxxxxx
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux