Re: [PATCH] FS-Cache: Add missing initialization of ret in cachefiles_write_page()

From: Geert Uytterhoeven
Date: Thu Nov 12 2015 - 05:23:45 EST

Hi David,

On Thu, Nov 12, 2015 at 11:15 AM, David Howells <dhowells@xxxxxxxxxx> wrote:
> Geert Uytterhoeven <geert@xxxxxxxxxxxxxx> wrote:
>> - int ret;
>> + int ret = 0;
> This isn't quite the right solution. The uninitialised error path needs to
> set -ENOBUFS.

That's what your commit 102f4d900c9c8f5e ("FS-Cache: Handle a write to the
page immediately beyond the EOF marker") does, and is also in its commit

Whilst we're at it, change the triggered assertion in CacheFiles to just
return -ENOBUFS instead.

"ret" is used only to print the original error in a debug message.

> Unfortunately, my compiler doesn't show a warning:-/

Need old gcc (4.1.2 ;-)



Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at