[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGXu5jKb1csho4q2-1o8sXhFoqyVfRVOyjWH-F7n86fObHQkxQ@mail.gmail.com>
Date: Thu, 17 Nov 2011 10:19:11 -0800
From: Kees Cook <keescook@...omium.org>
To: Arnd Bergmann <arnd@...db.de>
Cc: linux-kernel@...r.kernel.org, Greg Kroah-Hartman <gregkh@...e.de>,
Andrew Morton <akpm@...ux-foundation.org>,
Nicolas Pitre <nicolas.pitre@...aro.org>,
Ben Gardner <bgardner@...tec.com>,
Marco Stornelli <marco.stornelli@...il.com>,
Paul Gortmaker <paul.gortmaker@...driver.com>
Subject: Re: [PATCH 1/2] ramoops: use pstore interface
On Thu, Nov 17, 2011 at 7:07 AM, Arnd Bergmann <arnd@...db.de> wrote:
> On Wednesday 16 November 2011, Kees Cook wrote:
>> Instead of using /dev/mem directly, use the common pstore infrastructure
>> to handle Oops gathering and extraction.
>>
>> Signed-off-by: Kees Cook <keescook@...omium.org>
>
> Sounds like a very good plan to me. It probably makes sense to move the
> entire driver into fs/pstore after this. Otherwise, I have only trivial
> style comments:
>
>> +static int ramoops_pstore_open(struct pstore_info *psi);
>> +static int ramoops_pstore_close(struct pstore_info *psi);
>> +static ssize_t ramoops_pstore_read(u64 *id, enum pstore_type_id *type,
>> + struct timespec *time,
>> + char **buf,
>> + struct pstore_info *psi);
>> +static int ramoops_pstore_write(enum pstore_type_id type,
>> + enum kmsg_dump_reason reason, u64 *id,
>> + unsigned int part,
>> + size_t size, struct pstore_info *psi);
>> +static int ramoops_pstore_erase(enum pstore_type_id type, u64 id,
>> + struct pstore_info *psi);
>
> Can you do it without forward declarations? Many people find code
> more readable if it is structure in the natural order that avoids
> these.
Actually, now that I look at it again, yeah, I can. When I did this
originally I hadn't noticed pstore_info.data. I'll use that to pass
cxt so I can avoid the forward declarations. Thanks!
>> +static int ramoops_pstore_close(struct pstore_info *psi)
>> +{
>> + return 0;
>> +}
>
> Do you actually have to provide this if it's empty?
Yeah, though I suppose we could change pstore to DTRT in fs/pstore/platform.c:
if (psi->close) psi->close(psi);
instead of the current:
psi->close(psi);
> If yes, it might make sense to change the pstore code so that
> it works without a close function.
Yeah, I'll do that and send more patches. :)
Thanks!
-Kees
--
Kees Cook
ChromeOS Security
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists