Messages in this thread | | | From | David Howells <> | Subject | Re: [PATCH] fix page leak during core dump | Date | Sat, 31 Mar 2007 13:57:29 +0100 |
| |
Andrew Morton <akpm@linux-foundation.org> wrote:
> <would anyone be interested in hearing my opinion on the DUMP_SEEK macro > again?>
I can guess. And it's very probably right. Macros containing return statements like that are dodgy as they help people screw up the error handling.
However, ...
Andrew Morton <akpm@linux-foundation.org> wrote:
> - DUMP_SEEK(file->f_pos + PAGE_SIZE); > - page_cache_release(page); > + if (!dump_seek(file, file->f_pos + PAGE_SIZE)) { > + page_cache_release(page); > + return 0; > + }
Is not correct as you've then eliminated the page_cache_release() on the success path. What you probably intended was:
int tmp; ... tmp = dump_seek(file, file->f_pos + PAGE_SIZE); page_cache_release(page); if (!tmp) return 0;
David - 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/
| |