Thread (2 messages) 2 messages, 2 authors, 2019-01-28

Re: [PATCH] ext2: Remove useless reset code

From: Jan Kara <jack@suse.cz>
Date: 2019-01-28 14:48:53
Also in: lkml

On Fri 25-01-19 22:01:04, Liu Xiang wrote:
If ((char *)de == dir_end) is true, the name_len will not be used
in the subsequent routine. So the reset code can be removed.

Signed-off-by: Liu Xiang <redacted>
Thanks for the patch. I agree with your analysis but I prefer to keep the
code as is - it prevents warnings about uninitialized variable being used
for compilers than cannot infer that and also for humans reading the code
is easier this way.

								Honza
quoted hunk ↗ jump to hunk
---
 fs/ext2/dir.c | 1 -
 1 file changed, 1 deletion(-)
diff --git a/fs/ext2/dir.c b/fs/ext2/dir.c
index 3b8114d..5ec497f 100644
--- a/fs/ext2/dir.c
+++ b/fs/ext2/dir.c
@@ -517,7 +517,6 @@ int ext2_add_link (struct dentry *dentry, struct inode *inode)
 		while ((char *)de <= kaddr) {
 			if ((char *)de == dir_end) {
 				/* We hit i_size */
-				name_len = 0;
 				rec_len = chunk_size;
 				de->rec_len = ext2_rec_len_to_disk(chunk_size);
 				de->inode = 0;
-- 
1.9.1
-- 
Jan Kara [off-list ref]
SUSE Labs, CR
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help