lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241204151200.399599-1-colin.i.king@gmail.com>
Date: Wed,  4 Dec 2024 15:12:00 +0000
From: Colin Ian King <colin.i.king@...il.com>
To: David Howells <dhowells@...hat.com>,
	Marc Dionne <marc.dionne@...istor.com>,
	linux-afs@...ts.infradead.org
Cc: kernel-janitors@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: [PATCH][next] afs: remove redudant use of variable ret in afs_dir_iterate_contents

The variable ret is being initialized with 0 and is never re-assigned.
At the end of the function the check for ret being set to -ESTALE
is always false, so the check and the call to afs_invalidate_dir is
redundant. Remove ret and this check and just return 0 at the end
of the function.

Signed-off-by: Colin Ian King <colin.i.king@...il.com>
---
 fs/afs/dir.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/fs/afs/dir.c b/fs/afs/dir.c
index b6a202fd9926..83233814bd19 100644
--- a/fs/afs/dir.c
+++ b/fs/afs/dir.c
@@ -488,7 +488,6 @@ static int afs_dir_iterate_contents(struct inode *dir, struct dir_context *ctx)
 	struct afs_vnode *dvnode = AFS_FS_I(dir);
 	struct iov_iter iter;
 	unsigned long long i_size = i_size_read(dir);
-	int ret = 0;
 
 	/* Round the file position up to the next entry boundary */
 	ctx->pos = round_up(ctx->pos, sizeof(union afs_xdr_dirent));
@@ -502,9 +501,7 @@ static int afs_dir_iterate_contents(struct inode *dir, struct dir_context *ctx)
 	iterate_folioq(&iter, iov_iter_count(&iter), dvnode, ctx,
 		       afs_dir_iterate_step);
 
-	if (ret == -ESTALE)
-		afs_invalidate_dir(dvnode, afs_dir_invalid_iter_stale);
-	return ret;
+	return 0;
 }
 
 /*
-- 
2.39.5


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ