From 00b2b0f9d829988167de5345410dfd6613151a8d Mon Sep 17 00:00:00 2001 From: Tetsuhiro Kohada Date: Wed, 10 Feb 2021 16:13:24 +0800 Subject: [PATCH] exfat: remove useless check in exfat_move_file() In exfat_move_file(), the identity of source and target directory has been checked by the caller. Also, it gets stream.start_clu from file dir-entry, which is an invalid determination. Signed-off-by: Tetsuhiro Kohada Acked-by: Sungjong Seo Signed-off-by: Namjae Jeon Git-commit: eae503f7eb0509594076a951e422e29082385c96 Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git Signed-off-by: lixiang --- fs/exfat/namei.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/fs/exfat/namei.c b/fs/exfat/namei.c index b74227a9b216..adf962a67f4a 100644 --- a/fs/exfat/namei.c +++ b/fs/exfat/namei.c @@ -1094,11 +1094,6 @@ static int exfat_move_file(struct inode *inode, struct exfat_chain *p_olddir, if (!epmov) return -EIO; - /* check if the source and target directory is the same */ - if (exfat_get_entry_type(epmov) == TYPE_DIR && - le32_to_cpu(epmov->dentry.stream.start_clu) == p_newdir->dir) - return -EINVAL; - num_old_entries = exfat_count_ext_entries(sb, p_olddir, oldentry, epmov); if (num_old_entries < 0)