Linux-ext4 Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] ext4: remove unnecessary assignment in ext4_htree_store_dirent()
@ 2019-12-06  5:43 Chengguang Xu
  2020-01-13 18:52 ` Theodore Y. Ts'o
  0 siblings, 1 reply; 2+ messages in thread
From: Chengguang Xu @ 2019-12-06  5:43 UTC (permalink / raw)
  To: tytso, adilger.kernel; +Cc: linux-ext4, Chengguang Xu

We have allocated memory using kzalloc() so don't have
to set 0 again in last byte.

Signed-off-by: Chengguang Xu <cgxu519@mykernel.net>
---
 fs/ext4/dir.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/fs/ext4/dir.c b/fs/ext4/dir.c
index 9fdd2b269d61..5923c9147ae7 100644
--- a/fs/ext4/dir.c
+++ b/fs/ext4/dir.c
@@ -458,7 +458,6 @@ int ext4_htree_store_dirent(struct file *dir_file, __u32 hash,
 	new_fn->name_len = ent_name->len;
 	new_fn->file_type = dirent->file_type;
 	memcpy(new_fn->name, ent_name->name, ent_name->len);
-	new_fn->name[ent_name->len] = 0;
 
 	while (*p) {
 		parent = *p;
-- 
2.20.1




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] ext4: remove unnecessary assignment in ext4_htree_store_dirent()
  2019-12-06  5:43 [PATCH] ext4: remove unnecessary assignment in ext4_htree_store_dirent() Chengguang Xu
@ 2020-01-13 18:52 ` Theodore Y. Ts'o
  0 siblings, 0 replies; 2+ messages in thread
From: Theodore Y. Ts'o @ 2020-01-13 18:52 UTC (permalink / raw)
  To: Chengguang Xu; +Cc: adilger.kernel, linux-ext4

On Fri, Dec 06, 2019 at 01:43:17PM +0800, Chengguang Xu wrote:
> We have allocated memory using kzalloc() so don't have
> to set 0 again in last byte.
> 
> Signed-off-by: Chengguang Xu <cgxu519@mykernel.net>

Thanks, applied.

					- Ted

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-06  5:43 [PATCH] ext4: remove unnecessary assignment in ext4_htree_store_dirent() Chengguang Xu
2020-01-13 18:52 ` Theodore Y. Ts'o

Linux-ext4 Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-ext4/0 linux-ext4/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-ext4 linux-ext4/ https://lore.kernel.org/linux-ext4 \
		linux-ext4@vger.kernel.org
	public-inbox-index linux-ext4

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-ext4


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git