Skip to contentSkip to conversation

nfsd: Remove unnecessary assignment in nfs4xdr.c

PATCH Applied Alex Dewar 4 participants 7 messages Aug 12, 2020 – Aug 26, 2020

Subsystems (2)
lore
Share & tools
lore

Alex Dewar

author
#0 lore raw

PATCH 1/2 nfsd: Remove unnecessary assignment in nfs4xdr.c

In nfsd4_encode_listxattrs(), the variable p is assigned to at one point but this value is never used before p is reassigned. Fix this.

Addresses-Coverity: ("Unused value")

---
 fs/nfsd/nfs4xdr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/nfsd/nfs4xdr.c +1 -1
index 259d5ad0e3f47..1a0341fd80f9a 100644
@@ -4859,7 +4859,7 @@ nfsd4_encode_listxattrs(struct nfsd4_compoundres *resp, __be32 nfserr,
 			goto out;
 		}
 
-		p = xdr_encode_opaque(p, sp, slen);
+		xdr_encode_opaque(p, sp, slen);
 
 		xdrleft -= xdrlen;
 		count++;
Signature · 1 line
2.28.0
author
#1 lore raw

PATCH 2/2 nfsd: Fix typo in comment

Fix typos in nfs4xdr.c.

---
 fs/nfsd/nfs4xdr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/nfsd/nfs4xdr.c +1 -1
index 1a0341fd80f9a..3db789139a71f 100644
@@ -4828,7 +4828,7 @@ nfsd4_encode_listxattrs(struct nfsd4_compoundres *resp, __be32 nfserr,
 		slen = strlen(sp);
 
 		/*
-		 * Check if this a user. attribute, skip it if not.
+		 * Check if this is a user attribute, skip it if not.
 		 */
 		if (strncmp(sp, XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN))
 			goto contloop;
Signature · 1 line
2.28.0
#2 lore raw

Re: [PATCH 2/2] nfsd: Fix typo in comment

Quoted 22 lines · Alex Dewar

Fix typos in nfs4xdr.c.

---
 fs/nfsd/nfs4xdr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/nfsd/nfs4xdr.c +1 -2
index 1a0341fd80f9a..3db789139a71f 100644
@@ -4828,7 +4828,7 @@ nfsd4_encode_listxattrs(struct nfsd4_compoundres *resp, __be32 nfserr,
                slen = strlen(sp);
 
                /*
-                * Check if this a user. attribute, skip it if not.
+                * Check if this is a user attribute, skip it if not.
                 */
                if (strncmp(sp, XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN))
                        goto contloop;
--
Quoted 2 lines

2.28.0

"this a" should indeed by "this is a", but "user." is not a typo - it is talking about checking the prefix of the extended attribute, which is "user.", so the "." is intended to be there.

Thanks,

- Frank

#3 lore raw
In reply to Alex Dewar
Quoted 24 lines · Alex Dewar

In nfsd4_encode_listxattrs(), the variable p is assigned to at one point but this value is never used before p is reassigned. Fix this.

Addresses-Coverity: ("Unused value")

---
 fs/nfsd/nfs4xdr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/nfsd/nfs4xdr.c +1 -2
index 259d5ad0e3f47..1a0341fd80f9a 100644
@@ -4859,7 +4859,7 @@ nfsd4_encode_listxattrs(struct nfsd4_compoundres *resp, __be32 nfserr,
                        goto out;
                }
 
-               p = xdr_encode_opaque(p, sp, slen);
+               xdr_encode_opaque(p, sp, slen);
 
                xdrleft -= xdrlen;
                count++;
--
Quoted 2 lines

2.28.0

Yep, I guess my linting missed that, thanks for the fix.

- Frank

#4 lore raw
Quoted 26 lines · Frank van der Linden
Quoted 21 lines · Alex Dewar

In nfsd4_encode_listxattrs(), the variable p is assigned to at one point but this value is never used before p is reassigned. Fix this.

Addresses-Coverity: ("Unused value")

---
fs/nfsd/nfs4xdr.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
fs/nfsd/nfs4xdr.c +1 -1
index 259d5ad0e3f47..1a0341fd80f9a 100644
@@ -4859,7 +4859,7 @@ nfsd4_encode_listxattrs(struct nfsd4_compoundres *resp, __be32 nfserr,
                       goto out;
               }
 
-               p = xdr_encode_opaque(p, sp, slen);
+               xdr_encode_opaque(p, sp, slen);
 
Quoted 7 lines
Quoted 5 lines
fs/nfsd/nfs4xdr.c +0 -1
               xdrleft -= xdrlen;
               count++;
--

2.28.0

Yep, I guess my linting missed that, thanks for the fix.

Bruce, these two don't appear to be urgent, so I'm deferring them to you for v5.10.

--
Chuck Lever

author
#5 lore raw
In reply to Frank van der Linden
Quoted 30 lines · Frank van der Linden
Quoted 24 lines · Alex Dewar

In nfsd4_encode_listxattrs(), the variable p is assigned to at one point but this value is never used before p is reassigned. Fix this.

Addresses-Coverity: ("Unused value")

---
 fs/nfsd/nfs4xdr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/nfsd/nfs4xdr.c +1 -2
index 259d5ad0e3f47..1a0341fd80f9a 100644
@@ -4859,7 +4859,7 @@ nfsd4_encode_listxattrs(struct nfsd4_compoundres *resp, __be32 nfserr,
                        goto out;
                }
 
-               p = xdr_encode_opaque(p, sp, slen);
+               xdr_encode_opaque(p, sp, slen);
 
                xdrleft -= xdrlen;
                count++;
--
Quoted 2 lines

2.28.0

Yep, I guess my linting missed that, thanks for the fix.

Quoted 1 line

- Frank

Ping? The second patch in this series had a mistake in it, but I think this one's still good to go :-)

#6 lore raw
Quoted 31 lines · Alex Dewar
Quoted 30 lines · Frank van der Linden
Quoted 24 lines · Alex Dewar

In nfsd4_encode_listxattrs(), the variable p is assigned to at one point but this value is never used before p is reassigned. Fix this.

Addresses-Coverity: ("Unused value")

---
 fs/nfsd/nfs4xdr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/nfsd/nfs4xdr.c +1 -2
index 259d5ad0e3f47..1a0341fd80f9a 100644
@@ -4859,7 +4859,7 @@ nfsd4_encode_listxattrs(struct nfsd4_compoundres *resp, __be32 nfserr,
                        goto out;
                }
 
-               p = xdr_encode_opaque(p, sp, slen);
+               xdr_encode_opaque(p, sp, slen);
 
                xdrleft -= xdrlen;
                count++;
--
Quoted 2 lines

2.28.0

Yep, I guess my linting missed that, thanks for the fix.

Quoted 4 lines
Quoted 1 line

- Frank

Ping? The second patch in this series had a mistake in it, but I think this one's still good to go :-)

Thanks, applied for 5.10.--b.