linux-stable/fs/exfat
Sungjong Seo 204e6ceaa1 exfat: use updated exfat_chain directly during renaming
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 d8dad2588a ("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: d8dad2588a ("exfat: fix referencing wrong parent directory information after renaming")
Reported-by: Wang Yugui <wangyugui@e16-tech.com>
Signed-off-by: Sungjong Seo <sj1557.seo@samsung.com>
Tested-by: Wang Yugui <wangyugui@e16-tech.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2022-06-09 21:26:32 +09:00
..
balloc.c exfat: check if cluster num is valid 2022-05-23 11:17:30 +09:00
cache.c exfat: fix use of uninitialized spinlock on error path 2020-10-07 14:27:13 +09:00
dir.c exfat: remove argument 'sector' from exfat_get_dentry() 2022-01-10 11:00:03 +09:00
exfat_fs.h exfat: check if cluster num is valid 2022-05-23 11:17:30 +09:00
exfat_raw.h exfat: fix shift-out-of-bounds in exfat_fill_super() 2021-02-22 09:55:13 +09:00
fatent.c exfat: check if cluster num is valid 2022-05-23 11:17:30 +09:00
file.c block: add a bdev_discard_granularity helper 2022-04-17 19:49:59 -06:00
inode.c fs: Convert mpage_readpage to mpage_read_folio 2022-05-09 16:21:44 -04:00
Kconfig exfat: Improve wording of EXFAT_DEFAULT_IOCHARSET config option 2020-06-09 16:48:39 +09:00
Makefile
misc.c exfat: introduce mount option 'sys_tz' 2022-05-23 11:17:29 +09:00
namei.c exfat: use updated exfat_chain directly during renaming 2022-06-09 21:26:32 +09:00
nls.c exfat: remove argument 'sector' from exfat_get_dentry() 2022-01-10 11:00:03 +09:00
super.c Description for this pull request: 2022-05-24 18:30:27 -07:00