[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <201008171515.26175.arnd@arndb.de>
Date: Tue, 17 Aug 2010 15:15:26 +0200
From: Arnd Bergmann <arnd@...db.de>
To: Namhyung Kim <namhyung@...il.com>
Cc: Ingo Molnar <mingo@...e.hu>,
Andrew Morton <akpm@...ux-foundation.org>,
Alexander Viro <viro@...iv.linux.org.uk>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] init/do_mounts.c: replace sys_mount() to do_mount()
On Tuesday 17 August 2010, Namhyung Kim wrote:
> static int __init do_mount_root(char *name, char *fs, int flags, void *data)
> {
> - int err = sys_mount(name, "/root", fs, flags, data);
> + int err;
> + unsigned long data_page = 0;
> +
> + if (data) {
> + /* data should be in a page */
> + data_page = __get_free_page(GFP_KERNEL);
> + if (!data_page)
> + return -ENOMEM;
> + strlcpy((char *) data_page, data, PAGE_SIZE);
> + }
> +
> + err = do_mount(name, "/root", fs, flags, (void *) data_page);
> +
> + if (data_page)
> + free_page(data_page);
AFAICT there is no need for the copy at all here. The reason that sys_mount
copies to a separate page is that it gets passed an arbitrary-length user
input.
Arnd
--
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