Re: [PATCH v2] vfs: avoid recopying file names in getname_flags

2015-04-13 Thread Boqun Feng
On Sun, Apr 12, 2015 at 02:13:18AM +0100, Al Viro wrote: > > BTW, looking at the __getname() callers... Lustre one sure as hell looks > bogus: > char *tmp = __getname(); > > if (!tmp) > return ERR_PTR(-ENOMEM); > > len = strncpy_from_user(tmp, filename, P

Re: [PATCH v2] vfs: avoid recopying file names in getname_flags

2015-04-12 Thread Boqun Feng
Hi Al, On Sun, Apr 12, 2015 at 12:56:55AM +0100, Al Viro wrote: > On Tue, Apr 07, 2015 at 04:38:26PM +0800, Boqun Feng wrote: > > Ping again... > > What exactly does it buy us? You need a pathname just a bit under 4Kb, which, > with all due respect, is an extremely rare case. Resulting code is

Re: [PATCH v2] vfs: avoid recopying file names in getname_flags

2015-04-11 Thread Al Viro
On Sun, Apr 12, 2015 at 12:56:55AM +0100, Al Viro wrote: > What for? It's not as if userland memory had been communicated with by > IP over carrier pigeons, after all, and the cost of 4Kb worth of > (essentially) memcpy() is going to be > a) incurred in extremely rare case > and > b)

Re: [PATCH v2] vfs: avoid recopying file names in getname_flags

2015-04-11 Thread Al Viro
On Tue, Apr 07, 2015 at 04:38:26PM +0800, Boqun Feng wrote: > Ping again... What exactly does it buy us? You need a pathname just a bit under 4Kb, which, with all due respect, is an extremely rare case. Resulting code is more complicated, we _still_ copy twice (sure, the second time is for 16 by

Re: [PATCH v2] vfs: avoid recopying file names in getname_flags

2015-04-07 Thread Boqun Feng
Ping again... Thanks, Boqun Feng On Sun, Mar 29, 2015 at 12:27:44PM +0800, Boqun Feng wrote: > Ping. > > This patch has been tested by 0day test bot. > > Thanks, > Boqun Feng > > > On Thu, Mar 26, 2015 at 02:45:52AM +0800, Boqun Feng wrote: > > In the current implementation of getname_flags,

Re: [PATCH v2] vfs: avoid recopying file names in getname_flags

2015-03-29 Thread Boqun Feng
On Sun, Mar 29, 2015 at 12:14:24PM +0200, Richard Weinberger wrote: > On Sun, Mar 29, 2015 at 6:27 AM, Boqun Feng wrote: > > Ping. > > > > This patch has been tested by 0day test bot. > > I hope you did more than build test this patch... I did, I boot the new kernel and ran some scripts for crea

Re: [PATCH v2] vfs: avoid recopying file names in getname_flags

2015-03-29 Thread Boqun Feng
Hi Richard, On Sun, Mar 29, 2015 at 12:13:29PM +0200, Richard Weinberger wrote: > On Wed, Mar 25, 2015 at 7:45 PM, Boqun Feng wrote: > > In the current implementation of getname_flags, a file name in the > > user-space will be recopied if it takes more space that > > EMBEDDED_NAME_MAX, however, a

Re: [PATCH v2] vfs: avoid recopying file names in getname_flags

2015-03-29 Thread Richard Weinberger
On Sun, Mar 29, 2015 at 6:27 AM, Boqun Feng wrote: > Ping. > > This patch has been tested by 0day test bot. I hope you did more than build test this patch... -- Thanks, //richard -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vge

Re: [PATCH v2] vfs: avoid recopying file names in getname_flags

2015-03-29 Thread Richard Weinberger
On Wed, Mar 25, 2015 at 7:45 PM, Boqun Feng wrote: > In the current implementation of getname_flags, a file name in the > user-space will be recopied if it takes more space that > EMBEDDED_NAME_MAX, however, at this moment, EMBEDDED_NAME_MAX bytes of > the file name are already copied into kernel

Re: [PATCH v2] vfs: avoid recopying file names in getname_flags

2015-03-28 Thread Boqun Feng
Ping. This patch has been tested by 0day test bot. Thanks, Boqun Feng On Thu, Mar 26, 2015 at 02:45:52AM +0800, Boqun Feng wrote: > In the current implementation of getname_flags, a file name in the > user-space will be recopied if it takes more space that > EMBEDDED_NAME_MAX, however, at this