提交 0435096f 编写于 作者: K Konstantin Khlebnikov 提交者: Xie XiuQi

kernfs: update comment about kernfs_path() return value

mainline inclusion
from mainline-4.20-rc1
commit 8f5be0ec23bb9ef3f96659c8dff1340b876600bf
category: bugfix
bugzilla: 5564
CVE: NA

---------------------------

Now it returns the length of the full path or error code.
Signed-off-by: NKonstantin Khlebnikov <khlebnikov@yandex-team.ru>
Fixes: 3abb1d90 ("kernfs: make kernfs_path*() behave in the style of strlcpy()")
Acked-by: NTejun Heo <tj@kernel.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NJason Yan <yanaijie@huawei.com>
Reviewed-by: Nzhengbin <zhengbin13@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 9baadf68
...@@ -477,10 +477,11 @@ static inline void kernfs_init(void) { } ...@@ -477,10 +477,11 @@ static inline void kernfs_init(void) { }
* @buf: buffer to copy @kn's name into * @buf: buffer to copy @kn's name into
* @buflen: size of @buf * @buflen: size of @buf
* *
* Builds and returns the full path of @kn in @buf of @buflen bytes. The * If @kn is NULL result will be "(null)".
* path is built from the end of @buf so the returned pointer usually *
* doesn't match @buf. If @buf isn't long enough, @buf is nul terminated * Returns the length of the full path. If the full length is equal to or
* and %NULL is returned. * greater than @buflen, @buf contains the truncated path with the trailing
* '\0'. On error, -errno is returned.
*/ */
static inline int kernfs_path(struct kernfs_node *kn, char *buf, size_t buflen) static inline int kernfs_path(struct kernfs_node *kn, char *buf, size_t buflen)
{ {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册