diff options
author | Tejun Heo <tj@kernel.org> | 2014-02-10 19:34:30 -0500 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2014-02-10 19:34:30 -0500 |
commit | a8fa94e0f2ab665f9aa665195618178b61ed8304 (patch) | |
tree | 4060502fffd7f56d379372d517f8dcc31bf63955 /fs/namei.c | |
parent | 9561a8961c708ff6ba3e71a817af0f16bdc1d885 (diff) | |
parent | b28a960c42fcd9cfc987441fa6d1c1a471f0f9ed (diff) | |
download | op-kernel-dev-a8fa94e0f2ab665f9aa665195618178b61ed8304.zip op-kernel-dev-a8fa94e0f2ab665f9aa665195618178b61ed8304.tar.gz |
Merge branch 'master' into driver-core-next-test-merge-rc2
da9846ae1518 ("kernfs: make kernfs_deactivate() honor KERNFS_LOCKDEP
flag") in driver-core-linus conflicts with kernfs_drain() updates in
driver-core-next. The former just adds the missing KERNFS_LOCKDEP
checks which are already handled by kernfs_lockdep() checks in
driver-core-next. The conflict can be resolved by taking code from
driver-core-next.
Conflicts:
fs/kernfs/dir.c
Diffstat (limited to 'fs/namei.c')
-rw-r--r-- | fs/namei.c | 30 |
1 files changed, 30 insertions, 0 deletions
@@ -196,6 +196,7 @@ recopy: goto error; result->uptr = filename; + result->aname = NULL; audit_getname(result); return result; @@ -210,6 +211,35 @@ getname(const char __user * filename) return getname_flags(filename, 0, NULL); } +/* + * The "getname_kernel()" interface doesn't do pathnames longer + * than EMBEDDED_NAME_MAX. Deal with it - you're a kernel user. + */ +struct filename * +getname_kernel(const char * filename) +{ + struct filename *result; + char *kname; + int len; + + len = strlen(filename); + if (len >= EMBEDDED_NAME_MAX) + return ERR_PTR(-ENAMETOOLONG); + + result = __getname(); + if (unlikely(!result)) + return ERR_PTR(-ENOMEM); + + kname = (char *)result + sizeof(*result); + result->name = kname; + result->uptr = NULL; + result->aname = NULL; + result->separate = false; + + strlcpy(kname, filename, EMBEDDED_NAME_MAX); + return result; +} + #ifdef CONFIG_AUDITSYSCALL void putname(struct filename *name) { |