diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-02-17 15:27:47 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-02-17 15:27:47 -0800 |
commit | 05016b0f0a9d900e976db7f50a7761c0aefe5a1c (patch) | |
tree | 20b2f04fee785dc9ef81596cb2f7deec6d8016e0 /fs/open.c | |
parent | c6b1de1b646fe232206d4065df4d14040cebd613 (diff) | |
parent | 55422d0bd292f5ad143cc32cb8bb8505257274c4 (diff) |
Merge branch 'getname2' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull getname/putname updates from Al Viro:
"Rework of getname/getname_kernel/etc., mostly from Paul Moore. Gets
rid of quite a pile of kludges between namei and audit..."
* 'getname2' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
audit: replace getname()/putname() hacks with reference counters
audit: fix filename matching in __audit_inode() and __audit_inode_child()
audit: enable filename recording via getname_kernel()
simpler calling conventions for filename_mountpoint()
fs: create proper filename objects using getname_kernel()
fs: rework getname_kernel to handle up to PATH_MAX sized filenames
cut down the number of do_path_lookup() callers
Diffstat (limited to 'fs/open.c')
-rw-r--r-- | fs/open.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/fs/open.c b/fs/open.c index a293c2020676..33f9cbf2610b 100644 --- a/fs/open.c +++ b/fs/open.c @@ -968,8 +968,14 @@ struct file *file_open_name(struct filename *name, int flags, umode_t mode) */ struct file *filp_open(const char *filename, int flags, umode_t mode) { - struct filename name = {.name = filename}; - return file_open_name(&name, flags, mode); + struct filename *name = getname_kernel(filename); + struct file *file = ERR_CAST(name); + + if (!IS_ERR(name)) { + file = file_open_name(name, flags, mode); + putname(name); + } + return file; } EXPORT_SYMBOL(filp_open); |