From: Thadeu Lima de Souza Cascardo <cascardo@igalia.com>
To: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
Gwendal Grignou <gwendal@chromium.org>,
dlunev@chromium.org
Subject: Re: [PATCH] fat: ignore .. subdir and always add a link to dirs
Date: Wed, 13 Mar 2024 04:58:29 -0300 [thread overview]
Message-ID: <ZfFcpWRWdnWmtebd@quatroqueijos.cascardo.eti.br> (raw)
In-Reply-To: <87cys2jfop.fsf@mail.parknet.co.jp>
On Sun, Mar 10, 2024 at 11:59:34PM +0900, OGAWA Hirofumi wrote:
> Thadeu Lima de Souza Cascardo <cascardo@igalia.com> writes:
>
> >> If we really want to accept this image, we have to change the fat driver
> >> without affecting good image. And your patch affects to good image,
> >> because that patch doesn't count directory correctly, so bad link count.
> >>
> >
> > Well, it does behave the same on a correct image. It ignores the existence of
> > ".." when counting subdirs, but always adds an extra link count.
> >
> > So, images that have both "." and ".." subdirs, will have the 2 links, both
> > with the patch and without the patch.
>
> You are forgetting to count about normal dirs other than "." and ".."?
>
Yes, I was not counting those. The patch simply ignores ".." when counting dirs
(which is used only for determining the number of links), and always adds one
link. Then, when validating the inode, it also only requires that at least one
link exists instead of two.
There is only one other instance of fat_subdirs being called and that's when
the root dir link count is determined. I left that one unchanged, as usually
"." and ".." does not exist there and we always add two links there.
Cascardo.
> Thanks.
>
> > Images with neither dirs will be rejected before the patch and have a link
> > count of 1 after the patch. Still, creating and removing subdirs will work.
> > Removing the bad dir itself also works.
> >
> > Images with only "." or only ".." would have a link count of 1 and be rejected
> > without the patch.
> >
> > With the patch, directories with only ".." should behave the same as if they
> > had neither subdirs. That is, link count of 1. And directories with only "."
> > will have a link count of 2.
> --
> OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
next prev parent reply other threads:[~2024-03-13 7:58 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-22 20:30 [PATCH] fat: ignore .. subdir and always add a link to dirs Thadeu Lima de Souza Cascardo
2024-02-23 1:52 ` OGAWA Hirofumi
2024-02-23 2:02 ` Thadeu Lima de Souza Cascardo
2024-02-23 8:27 ` OGAWA Hirofumi
2024-02-23 8:32 ` OGAWA Hirofumi
2024-02-23 9:58 ` Thadeu Lima de Souza Cascardo
2024-02-23 12:29 ` OGAWA Hirofumi
2024-02-23 13:16 ` Thadeu Lima de Souza Cascardo
2024-02-23 13:33 ` Thadeu Lima de Souza Cascardo
2024-02-28 1:42 ` Thadeu Lima de Souza Cascardo
2024-02-28 3:38 ` OGAWA Hirofumi
2024-02-28 9:10 ` Thadeu Lima de Souza Cascardo
2024-03-04 23:37 ` Thadeu Lima de Souza Cascardo
2024-03-05 4:14 ` OGAWA Hirofumi
2024-03-10 5:52 ` OGAWA Hirofumi
2024-03-10 10:14 ` Thadeu Lima de Souza Cascardo
2024-03-10 14:59 ` OGAWA Hirofumi
2024-03-13 7:58 ` Thadeu Lima de Souza Cascardo [this message]
2024-03-13 8:05 ` OGAWA Hirofumi
2024-03-13 8:41 ` Thadeu Lima de Souza Cascardo
2024-03-13 11:06 ` OGAWA Hirofumi
2024-03-13 11:16 ` Thadeu Lima de Souza Cascardo
2024-03-13 12:43 ` OGAWA Hirofumi
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=ZfFcpWRWdnWmtebd@quatroqueijos.cascardo.eti.br \
--to=cascardo@igalia.com \
--cc=dlunev@chromium.org \
--cc=gwendal@chromium.org \
--cc=hirofumi@mail.parknet.co.jp \
--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;
as well as URLs for NNTP newsgroup(s).