Skip to contentSkip to conversation

nfs: nfs3acl: drop useless assignment in nfs3_get_acl()

PATCH In review Sergey Shtylyov 2 participants 2 messages Apr 9, 2025 – Apr 11, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nfs: nfs3acl: drop useless assignment in nfs3_get_acl()

In nfs3_get_acl(), the local variable status is assigned the result of nfs_refresh_inode() inside the *switch* statement, but that value gets overwritten in the next *if* statement's true branch and is completely ignored if that branch isn't taken...

Found by Linux Verification Center (linuxtesting.org) with the Svace static analysis tool.

---
This patch is against the linux-next branch of Trond Myklebust's linux-nfs.git repo.

 fs/nfs/nfs3acl.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/nfs/nfs3acl.c +1 -1
Index: linux-nfs/fs/nfs/nfs3acl.c
===================================================================
@@ -104,7 +104,7 @@ struct posix_acl *nfs3_get_acl(struct in
 
 	switch (status) {
 		case 0:
-			status = nfs_refresh_inode(inode, res.fattr);
+			nfs_refresh_inode(inode, res.fattr);
 			break;
 		case -EPFNOSUPPORT:
 		case -EPROTONOSUPPORT:
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Sergey Shtylyov

In nfs3_get_acl(), the local variable status is assigned the result of nfs_refresh_inode() inside the *switch* statement, but that value gets overwritten in the next *if* statement's true branch and is completely ignored if that branch isn't taken...

Found by Linux Verification Center (linuxtesting.org) with the Svace static analysis tool.

Ben