]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
exfat: fix referencing wrong parent directory information after renaming
authorYuezhang Mo <Yuezhang.Mo@sony.com>
Mon, 4 Apr 2022 02:58:06 +0000 (11:58 +0900)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 16 Sep 2022 08:53:32 +0000 (10:53 +0200)
commit91c5d8b3e9912c495159e6dd29f90f4a441fe0a7
tree187efa0ca28581990dc7af04992c0b636b7dfa79
parent6e9fc0dec6d9d521321d35a4b184ea9e61968599
exfat: fix referencing wrong parent directory information after renaming

BugLink: https://bugs.launchpad.net/bugs/1988479
[ Upstream commit d8dad2588addd1d861ce19e7df3b702330f0c7e3 ]

During renaming, the parent directory information maybe
updated. But the file/directory still references to the
old parent directory information.

This bug will cause 2 problems.

(1) The renamed file can not be written.

    [10768.175172] exFAT-fs (sda1): error, failed to bmap (inode : 7afd50e4 iblock : 0, err : -5)
    [10768.184285] exFAT-fs (sda1): Filesystem has been set read-only
    ash: write error: Input/output error

(2) Some dentries of the renamed file/directory are not set
    to deleted after removing the file/directory.

exfat_update_parent_info() is a workaround for the wrong parent
directory information being used after renaming. Now that bug is
fixed, this is no longer needed, so remove it.

Fixes: 5f2aa075070c ("exfat: add inode operations")
Cc: stable@vger.kernel.org # v5.7+
Signed-off-by: Yuezhang Mo <Yuezhang.Mo@sony.com>
Reviewed-by: Andy Wu <Andy.Wu@sony.com>
Reviewed-by: Aoyama Wataru <wataru.aoyama@sony.com>
Reviewed-by: Daniel Palmer <daniel.palmer@sony.com>
Reviewed-by: Sungjong Seo <sj1557.seo@samsung.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
fs/exfat/namei.c