Skip to content

Commit

Permalink
fs: nfs: sysfs: use sysfs_emit() to instead of scnprintf()
Browse files Browse the repository at this point in the history
Follow the advice of the Documentation/filesystems/sysfs.rst and show()
should only use sysfs_emit() or sysfs_emit_at() when formatting the
value to be returned to user space.

Signed-off-by: ye xingchen <[email protected]>
Signed-off-by: Trond Myklebust <[email protected]>
  • Loading branch information
ye xingchen authored and Trond Myklebust committed Dec 6, 2022
1 parent 700fa9b commit 19cdc8f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/nfs/sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ static ssize_t nfs_netns_identifier_show(struct kobject *kobj,
ssize_t ret;

rcu_read_lock();
ret = scnprintf(buf, PAGE_SIZE, "%s\n", rcu_dereference(c->identifier));
ret = sysfs_emit(buf, "%s\n", rcu_dereference(c->identifier));
rcu_read_unlock();
return ret;
}
Expand Down

0 comments on commit 19cdc8f

Please sign in to comment.