ecryptfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fs/ecryptfs: replace snprintf with sysfs_emit in show function
@ 2025-06-19  3:15 Ankit Chauhan
  2025-06-23 12:12 ` Christian Brauner
  0 siblings, 1 reply; 2+ messages in thread
From: Ankit Chauhan @ 2025-06-19  3:15 UTC (permalink / raw)
  To: code, brauner, sandeen, colin.i.king
  Cc: ecryptfs, linux-kernel, Ankit Chauhan

Use sysfs_emit() instead of snprintf() in version_show() function to
follow the preferred kernel API.

Signed-off-by: Ankit Chauhan <ankitchauhan2065@gmail.com>
---
 fs/ecryptfs/main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/ecryptfs/main.c b/fs/ecryptfs/main.c
index 8dd1d7189c3b..0db21e592fe7 100644
--- a/fs/ecryptfs/main.c
+++ b/fs/ecryptfs/main.c
@@ -20,6 +20,7 @@
 #include <linux/fs_context.h>
 #include <linux/fs_parser.h>
 #include <linux/fs_stack.h>
+#include <linux/sysfs.h>
 #include <linux/slab.h>
 #include <linux/magic.h>
 #include "ecryptfs_kernel.h"
@@ -764,7 +765,7 @@ static struct kobject *ecryptfs_kobj;
 static ssize_t version_show(struct kobject *kobj,
 			    struct kobj_attribute *attr, char *buff)
 {
-	return snprintf(buff, PAGE_SIZE, "%d\n", ECRYPTFS_VERSIONING_MASK);
+	return sysfs_emit(buff, "%d\n", ECRYPTFS_VERSIONING_MASK);
 }
 
 static struct kobj_attribute version_attr = __ATTR_RO(version);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] fs/ecryptfs: replace snprintf with sysfs_emit in show function
  2025-06-19  3:15 [PATCH] fs/ecryptfs: replace snprintf with sysfs_emit in show function Ankit Chauhan
@ 2025-06-23 12:12 ` Christian Brauner
  0 siblings, 0 replies; 2+ messages in thread
From: Christian Brauner @ 2025-06-23 12:12 UTC (permalink / raw)
  To: code, sandeen, colin.i.king, Ankit Chauhan
  Cc: Christian Brauner, ecryptfs, linux-kernel

On Thu, 19 Jun 2025 08:45:36 +0530, Ankit Chauhan wrote:
> Use sysfs_emit() instead of snprintf() in version_show() function to
> follow the preferred kernel API.
> 
> 

Applied to the vfs-6.17.misc branch of the vfs/vfs.git tree.
Patches in the vfs-6.17.misc branch should appear in linux-next soon.

Please report any outstanding bugs that were missed during review in a
new review to the original patch series allowing us to drop it.

It's encouraged to provide Acked-bys and Reviewed-bys even though the
patch has now been applied. If possible patch trailers will be updated.

Note that commit hashes shown below are subject to change due to rebase,
trailer updates or similar. If in doubt, please check the listed branch.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: vfs-6.17.misc

[1/1] fs/ecryptfs: replace snprintf with sysfs_emit in show function
      https://git.kernel.org/vfs/vfs/c/06a705356d75

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-06-23 12:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-19  3:15 [PATCH] fs/ecryptfs: replace snprintf with sysfs_emit in show function Ankit Chauhan
2025-06-23 12:12 ` Christian Brauner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).