Skip to content

Commit 19cdc8f

Browse files
ye xingchenTrond Myklebust
authored andcommitted
fs: nfs: sysfs: use sysfs_emit() to instead of scnprintf()
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 <ye.xingchen@zte.com.cn> Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
1 parent 700fa9b commit 19cdc8f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/nfs/sysfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ static ssize_t nfs_netns_identifier_show(struct kobject *kobj,
8282
ssize_t ret;
8383

8484
rcu_read_lock();
85-
ret = scnprintf(buf, PAGE_SIZE, "%s\n", rcu_dereference(c->identifier));
85+
ret = sysfs_emit(buf, "%s\n", rcu_dereference(c->identifier));
8686
rcu_read_unlock();
8787
return ret;
8888
}

0 commit comments

Comments
 (0)