From: Jeff Layton <jlayton@kernel.org>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
Jeff Layton <jlayton@kernel.org>
Subject: [PATCH] fuse: don't set file->private_data in fuse_conn_waiting_read
Date: Tue, 04 Feb 2025 10:04:00 -0500 [thread overview]
Message-ID: <20250204-fuse-fixes-v1-1-c1e1bed8cdb7@kernel.org> (raw)
I see no reason to set the private_data on the file to this value. Just
grab the result of the atomic_read() and output it without setting
private_data.
Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
fs/fuse/control.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/fs/fuse/control.c b/fs/fuse/control.c
index 2a730d88cc3bdb50ea1f8a3185faad5f05fc6e74..17ef07cf0c38e44bd7eadb3450bd53a8acc5e885 100644
--- a/fs/fuse/control.c
+++ b/fs/fuse/control.c
@@ -49,18 +49,17 @@ static ssize_t fuse_conn_waiting_read(struct file *file, char __user *buf,
{
char tmp[32];
size_t size;
+ int value;
if (!*ppos) {
- long value;
struct fuse_conn *fc = fuse_ctl_file_conn_get(file);
if (!fc)
return 0;
value = atomic_read(&fc->num_waiting);
- file->private_data = (void *)value;
fuse_conn_put(fc);
}
- size = sprintf(tmp, "%ld\n", (long)file->private_data);
+ size = sprintf(tmp, "%d\n", value);
return simple_read_from_buffer(buf, len, ppos, tmp, size);
}
---
base-commit: 9afd7336f3acbe5678cca3b3bc5baefb51ce9564
change-id: 20250204-fuse-fixes-03882c05c1b1
Best regards,
--
Jeff Layton <jlayton@kernel.org>
next reply other threads:[~2025-02-04 15:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-04 15:04 Jeff Layton [this message]
2025-02-05 18:13 ` Joanne Koong
2025-02-14 10:17 ` Miklos Szeredi
2025-02-14 12:58 ` Jeff Layton
2025-02-14 13:04 ` Miklos Szeredi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250204-fuse-fixes-v1-1-c1e1bed8cdb7@kernel.org \
--to=jlayton@kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=miklos@szeredi.hu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®