linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] staging: lustre: Replace ll_getname with vfs' getname
@ 2015-04-22  3:50 Boqun Feng
  2015-04-22  3:50 ` [PATCH 1/2] vfs: export symbol 'getname' and 'putname' Boqun Feng
  2015-04-22  3:50 ` [PATCH 2/2] staging: lustre: replace ll_{get, put}name() with {get, put}name() Boqun Feng
  0 siblings, 2 replies; 12+ messages in thread
From: Boqun Feng @ 2015-04-22  3:50 UTC (permalink / raw)
  To: linux-fsdevel, devel, linux-kernel
  Cc: Andreas Dilger, Greg Kroah-Hartman, Boqun Feng, Oleg Drokin,
	Al Viro, Jan Kara

As Al Viro pointed out:

https://lkml.org/lkml/2015/4/11/243

There are bugs in ll_getname() because of wrong assumptions of returning
values from strncpy_from_user(). Moreover, what ll_getname want to do is
just to try copy the file name from userland. Since we already have
getname() for the same purpose, it's better to replace ll_getname() with
getname().

To do that, we need to:
1) export the symbols of getname() and putname() to be used by modules.
2) actually replace ll_getname()/ll_putname() with getname()/putname().

One more thing is that as ll_getname() and getname() both treat a zero-length
file name as an error(-ENOENT), and if ll_getname() or getname() has an error,
ll_dir_ioctl() will return the error immediately, so checking whether these names
are zero-length is unnecessary and -ENIVAL shall not return from that code path,
no matter using ll_getname() or getname(). So remove the checking code. 

This patchset is based on v4.0, and I only did build tests, because I found a
little difficult to set up a lustre environment. I'll try to do the testing once
I'm able to set up an environment, in the meanwhile, comments,
inputs from lustre's point of view and voluntary tests are welcome. Thank you. ;-)

Regards,
Boqun Feng


Boqun Feng (2):
  vfs: Export symbol 'getname' and 'putname'
  staging: lustre: replace ll_{get,put}name() with {get,put}name()

 drivers/staging/lustre/lustre/llite/dir.c          | 60 ++++++----------------
 .../staging/lustre/lustre/llite/llite_internal.h   |  2 +-
 drivers/staging/lustre/lustre/llite/namei.c        |  2 +-
 fs/namei.c                                         | 18 +++++++
 4 files changed, 36 insertions(+), 46 deletions(-)

-- 
2.3.5

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2015-04-24  2:38 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-22  3:50 [PATCH 0/2] staging: lustre: Replace ll_getname with vfs' getname Boqun Feng
2015-04-22  3:50 ` [PATCH 1/2] vfs: export symbol 'getname' and 'putname' Boqun Feng
2015-04-22  5:53   ` Christoph Hellwig
2015-04-22  6:27     ` Drokin, Oleg
2015-04-22  6:31       ` Christoph Hellwig
2015-04-22  6:49         ` Drokin, Oleg
2015-04-22  7:34           ` Christoph Hellwig
2015-04-24  2:38             ` Drokin, Oleg
2015-04-22  6:31     ` Greg Kroah-Hartman
2015-04-22  6:40       ` Drokin, Oleg
2015-04-22  3:50 ` [PATCH 2/2] staging: lustre: replace ll_{get, put}name() with {get, put}name() Boqun Feng
2015-04-22  5:45   ` [PATCH 2/2] staging: lustre: replace ll_{get,put}name() with {get,put}name() Dilger, Andreas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).