mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Liu Xiang <liu.xiang6@zte.com.cn>
Cc: jack@suse.com, linux-ext4@vger.kernel.org,
	linux-kernel@vger.kernel.org, liuxiang_1999@126.com
Subject: Re: [PATCH] ext2: Remove useless reset code
Date: Mon, 28 Jan 2019 15:48:47 +0100	[thread overview]
Message-ID: <20190128144847.GG27972@quack2.suse.cz> (raw)
In-Reply-To: <1548424864-4647-1-git-send-email-liu.xiang6@zte.com.cn>

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 <liu.xiang6@zte.com.cn>

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

> ---
>  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 <jack@suse.com>
SUSE Labs, CR

      reply	other threads:[~2019-01-28 14:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-25 14:01 Liu Xiang
2019-01-28 14:48 ` Jan Kara [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190128144847.GG27972@quack2.suse.cz \
    --to=jack@suse.cz \
    --cc=jack@suse.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liu.xiang6@zte.com.cn \
    --cc=liuxiang_1999@126.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®