[lvc-project] [PATCH] nfs: nfs3acl: drop useless assignment in nfs3_get_acl()

Sergey Shtylyov s.shtylyov at omp.ru
Wed Apr 9 23:36:33 MSK 2025


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.

Signed-off-by: Sergey Shtylyov <s.shtylyov at omp.ru>

---
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(-)

Index: linux-nfs/fs/nfs/nfs3acl.c
===================================================================
--- linux-nfs.orig/fs/nfs/nfs3acl.c
+++ 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:



More information about the lvc-project mailing list