lkml.org 
[lkml]   [2012]   [Nov]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 7/9] pstore: make sure pstore_write exists on flush error
On Thu, Oct 18, 2012 at 02:06:05PM +0300, dragos.tatulea@intel.com wrote:
> From: Dragos Tatulea <dragos.tatulea@intel.com>
>
> Return error if flushing to backend failed.

I think you can easily fold this into 'pstore: add support for external
writers'.

Thanks.

> Signed-off-by: Dragos Tatulea <dragos.tatulea@intel.com>
> ---
> fs/pstore/platform.c | 8 +++-----
> 1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c
> index 3a4c38f..25f59ed 100644
> --- a/fs/pstore/platform.c
> +++ b/fs/pstore/platform.c
> @@ -445,7 +445,7 @@ void pstore_del_timer(void)
> int pstore_write(enum pstore_type_id type, const char *buf, size_t size)
> {
> size_t len;
> - int err = 0, err2;
> + int err = 0;
>
> if (!psinfo)
> return -ENODEV;
> @@ -461,16 +461,14 @@ int pstore_write(enum pstore_type_id type, const char *buf, size_t size)
> psinfo->ext_part = 1;
> }
>
> - while (size) {
> + while (size && !err) {
> len = min(size, psinfo->bufsize - psinfo->ext_len);
> memcpy(psinfo->buf + psinfo->ext_len, buf, len);
> psinfo->ext_len += len;
> buf += len;
> size -= len;
> if (psinfo->ext_len == psinfo->bufsize) {
> - err2 = pstore_ext_flush();
> - if (err2 && !err)
> - err = err2;
> + err = pstore_ext_flush();
> }
> }
>
> --
> 1.7.9.5


\
 
 \ /
  Last update: 2012-11-18 04:21    [W:0.058 / U:0.136 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site