From: Rosen Penev <rosenp@gmail.com>
To: codalist@coda.cs.cmu.edu
Cc: Jan Harkes <jaharkes@cs.cmu.edu>,
coda@cs.cmu.edu (maintainer:CODA FILE SYSTEM),
linux-kernel@vger.kernel.org (open list)
Subject: [PATCH] coda: upcall: only set outp in upcalls that read the reply
Date: Mon, 5 Oct 2026 13:47:15 -0700 [thread overview]
Message-ID: <20261005204715.259623-1-rosenp@gmail.com> (raw)
The UPARG() macro always assigns outp, but 10 of the upcall functions
never read it. With W=1 this triggers -Wunused-but-set-variable in
venus_setattr(), venus_close(), venus_rename(), venus_rmdir(),
venus_remove(), venus_link(), venus_symlink(), venus_fsync(),
venus_access() and venus_access_intent(), which breaks the build when
CONFIG_WERROR is enabled.
Drop the outp assignment from UPARG(), remove the unused outp variables,
and set outp explicitly in the upcalls that read the reply.
No functional change.
Assisted-by: LLM
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
fs/coda/upcall.c | 20 +++++++++-----------
1 file changed, 9 insertions(+), 11 deletions(-)
diff --git a/fs/coda/upcall.c b/fs/coda/upcall.c
index 3438119b5dcf..1e4cbe40ed20 100644
--- a/fs/coda/upcall.c
+++ b/fs/coda/upcall.c
@@ -62,7 +62,6 @@ static void *alloc_upcall(int opcode, int size)
do {\
inp = (union inputArgs *)alloc_upcall(op, insize); \
if (IS_ERR(inp)) { return PTR_ERR(inp); }\
- outp = (union outputArgs *)(inp); \
outsize = insize; \
} while (0)
@@ -80,6 +79,7 @@ int venus_rootfid(struct super_block *sb, struct CodaFid *fidp)
insize = SIZE(root);
UPARG(CODA_ROOT);
+ outp = (union outputArgs *)inp;
error = coda_upcall(coda_vcp(sb), insize, &outsize, inp);
if (!error)
@@ -98,6 +98,7 @@ int venus_getattr(struct super_block *sb, struct CodaFid *fid,
insize = SIZE(getattr);
UPARG(CODA_GETATTR);
+ outp = (union outputArgs *)inp;
inp->coda_getattr.VFid = *fid;
error = coda_upcall(coda_vcp(sb), insize, &outsize, inp);
@@ -112,7 +113,6 @@ int venus_setattr(struct super_block *sb, struct CodaFid *fid,
struct coda_vattr *vattr)
{
union inputArgs *inp;
- union outputArgs *outp;
int insize, outsize, error;
insize = SIZE(setattr);
@@ -139,6 +139,7 @@ int venus_lookup(struct super_block *sb, struct CodaFid *fid,
offset = INSIZE(lookup);
insize = max_t(unsigned int, offset + length +1, OUTSIZE(lookup));
UPARG(CODA_LOOKUP);
+ outp = (union outputArgs *)inp;
inp->coda_lookup.VFid = *fid;
inp->coda_lookup.name = offset;
@@ -161,7 +162,6 @@ int venus_close(struct super_block *sb, struct CodaFid *fid, int flags,
kuid_t uid)
{
union inputArgs *inp;
- union outputArgs *outp;
int insize, outsize, error;
insize = SIZE(release);
@@ -186,6 +186,7 @@ int venus_open(struct super_block *sb, struct CodaFid *fid,
insize = SIZE(open_by_fd);
UPARG(CODA_OPEN_BY_FD);
+ outp = (union outputArgs *)inp;
inp->coda_open_by_fd.VFid = *fid;
inp->coda_open_by_fd.flags = flags;
@@ -210,6 +211,7 @@ int venus_mkdir(struct super_block *sb, struct CodaFid *dirfid,
offset = INSIZE(mkdir);
insize = max_t(unsigned int, offset + length + 1, OUTSIZE(mkdir));
UPARG(CODA_MKDIR);
+ outp = (union outputArgs *)inp;
inp->coda_mkdir.VFid = *dirfid;
inp->coda_mkdir.attr = *attrs;
@@ -235,7 +237,6 @@ int venus_rename(struct super_block *sb, struct CodaFid *old_fid,
const char *new_name)
{
union inputArgs *inp;
- union outputArgs *outp;
int insize, outsize, error;
int offset, s;
@@ -278,6 +279,7 @@ int venus_create(struct super_block *sb, struct CodaFid *dirfid,
offset = INSIZE(create);
insize = max_t(unsigned int, offset + length + 1, OUTSIZE(create));
UPARG(CODA_CREATE);
+ outp = (union outputArgs *)inp;
inp->coda_create.VFid = *dirfid;
inp->coda_create.attr.va_mode = mode;
@@ -303,7 +305,6 @@ int venus_rmdir(struct super_block *sb, struct CodaFid *dirfid,
const char *name, int length)
{
union inputArgs *inp;
- union outputArgs *outp;
int insize, outsize, error;
int offset;
@@ -326,7 +327,6 @@ int venus_remove(struct super_block *sb, struct CodaFid *dirfid,
const char *name, int length)
{
union inputArgs *inp;
- union outputArgs *outp;
int error=0, insize, outsize, offset;
offset = INSIZE(remove);
@@ -356,6 +356,7 @@ int venus_readlink(struct super_block *sb, struct CodaFid *fid,
insize = max_t(unsigned int,
INSIZE(readlink), OUTSIZE(readlink)+ *length);
UPARG(CODA_READLINK);
+ outp = (union outputArgs *)inp;
inp->coda_readlink.VFid = *fid;
@@ -380,7 +381,6 @@ int venus_link(struct super_block *sb, struct CodaFid *fid,
struct CodaFid *dirfid, const char *name, int len )
{
union inputArgs *inp;
- union outputArgs *outp;
int insize, outsize, error;
int offset;
@@ -407,7 +407,6 @@ int venus_symlink(struct super_block *sb, struct CodaFid *fid,
const char *symname, int symlen)
{
union inputArgs *inp;
- union outputArgs *outp;
int insize, outsize, error;
int offset, s;
@@ -440,7 +439,6 @@ int venus_symlink(struct super_block *sb, struct CodaFid *fid,
int venus_fsync(struct super_block *sb, struct CodaFid *fid)
{
union inputArgs *inp;
- union outputArgs *outp;
int insize, outsize, error;
insize=SIZE(fsync);
@@ -456,7 +454,6 @@ int venus_fsync(struct super_block *sb, struct CodaFid *fid)
int venus_access(struct super_block *sb, struct CodaFid *fid, int mask)
{
union inputArgs *inp;
- union outputArgs *outp;
int insize, outsize, error;
insize = SIZE(access);
@@ -482,6 +479,7 @@ int venus_pioctl(struct super_block *sb, struct CodaFid *fid,
insize = VC_MAXMSGSIZE;
UPARG(CODA_IOCTL);
+ outp = (union outputArgs *)inp;
/* build packet for Venus */
if (data->vi.in_size > VC_MAXDATASIZE) {
@@ -555,6 +553,7 @@ int venus_statfs(struct dentry *dentry, struct kstatfs *sfs)
insize = SIZE(statfs);
UPARG(CODA_STATFS);
+ outp = (union outputArgs *)inp;
error = coda_upcall(coda_vcp(dentry->d_sb), insize, &outsize, inp);
if (!error) {
@@ -574,7 +573,6 @@ int venus_access_intent(struct super_block *sb, struct CodaFid *fid,
size_t count, loff_t ppos, int type)
{
union inputArgs *inp;
- union outputArgs *outp;
int insize, outsize, error;
bool finalizer =
type == CODA_ACCESS_TYPE_READ_FINISH ||
--
2.56.0
reply other threads:[~2026-10-05 20:47 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20261005204715.259623-1-rosenp@gmail.com \
--to=rosenp@gmail.com \
--cc=coda@cs.cmu.edu \
--cc=codalist@coda.cs.cmu.edu \
--cc=jaharkes@cs.cmu.edu \
--cc=linux-kernel@vger.kernel.org \
/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®