From: "Sungjong Seo" <sj1557.seo@samsung.com>
To: "'Namjae Jeon'" <linkinjeon@kernel.org>
Cc: <linux-kernel@vger.kernel.org>, <linux-fsdevel@vger.kernel.org>,
<sj1557.seo@samsung.com>
Subject: RE: [PATCH 1/2] exfat: fix referencing wrong parent directory information after renaming
Date: Fri, 1 Apr 2022 19:32:31 +0900 [thread overview]
Message-ID: <818a01d845b3$cb1a2360$614e6a20$@samsung.com> (raw)
In-Reply-To: <HK2PR04MB3891BE0766FAF0AEC39FE2DC811A9@HK2PR04MB3891.apcprd04.prod.outlook.com>
> 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.
>
> fixes: 5f2aa075070c ("exfat: add inode operations")
>
> 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>
Looks good!
Thanks for your patch!
Reviewed-by: Sungjong Seo <sj1557.seo@samsung.com>
> ---
> fs/exfat/namei.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/fs/exfat/namei.c b/fs/exfat/namei.c index
> a02a04a993bf..e7adb6bfd9d5 100644
> --- a/fs/exfat/namei.c
> +++ b/fs/exfat/namei.c
> @@ -1080,6 +1080,7 @@ static int exfat_rename_file(struct inode *inode,
> struct exfat_chain *p_dir,
>
> exfat_remove_entries(inode, p_dir, oldentry, 0,
> num_old_entries);
> + ei->dir = *p_dir;
> ei->entry = newentry;
> } else {
> if (exfat_get_entry_type(epold) == TYPE_FILE) {
> --
> 2.25.1
prev parent reply other threads:[~2022-04-01 10:32 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20220325094229epcas1p194e9008627d718a444253c1c7e58b2b8@epcas1p1.samsung.com>
2022-03-25 9:42 ` Yuezhang.Mo
2022-03-28 1:43 ` Namjae Jeon
2022-03-28 6:18 ` Yuezhang.Mo
2022-04-01 10:32 ` Sungjong Seo [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='818a01d845b3$cb1a2360$614e6a20$@samsung.com' \
--to=sj1557.seo@samsung.com \
--cc=linkinjeon@kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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®