Skip to content
Commit 9326a622 authored by Sungjong Seo's avatar Sungjong Seo Committed by Greg Kroah-Hartman
Browse files

exfat: use updated exfat_chain directly during renaming

commit 204e6cea upstream.

In order for a file to access its own directory entry set,
exfat_inode_info(ei) has two copied values. One is ei->dir, which is
a snapshot of exfat_chain of the parent directory, and the other is
ei->entry, which is the offset of the start of the directory entry set
in the parent directory.

Since the parent directory can be updated after the snapshot point,
it should be used only for accessing one's own directory entry set.

However, as of now, during renaming, it could try to traverse or to
allocate clusters via snapshot values, it does not make sense.

This potential problem has been revealed when exfat_update_parent_info()
was removed by commit d8dad258 ("exfat: fix referencing wrong parent
directory information after renaming"). However, I don't think it's good
idea to bring exfat_update_parent_info() back.

Instead, let's use the updated exfat_chain of parent directory diectly.

Fixes: d8dad258

 ("exfat: fix referencing wrong parent directory information after renaming")
Reported-by: default avatarWang Yugui <wangyugui@e16-tech.com>
Signed-off-by: default avatarSungjong Seo <sj1557.seo@samsung.com>
Tested-by: default avatarWang Yugui <wangyugui@e16-tech.com>
Signed-off-by: default avatarNamjae Jeon <linkinjeon@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent fe2cfc0b
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment