From: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Hungyu Lin <dennylin0707@gmail.com>,
brauner@kernel.org, linux-fsdevel@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] fat: fix parent link count when replacing a sibling directory
Date: Fri, 30 Oct 2026 04:59:51 +0900 [thread overview]
Message-ID: <874ie4tgzs.fsf@mail.parknet.co.jp> (raw)
In-Reply-To: <20261029121535.3347dc93905f38b23aada5cb@linux-foundation.org>
Andrew Morton <akpm@linux-foundation.org> writes:
> On Thu, 29 Oct 2026 14:57:43 +0900 OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> wrote:
>
>> Hungyu Lin <dennylin0707@gmail.com> writes:
>>
>> > vfat_rename() and do_msdos_rename() adjust parent link counts only when
>> > updating the dotdot entry for a move between different parents. Replacing
>> > an existing empty directory in the same parent also removes a
>> > subdirectory, but leaves the parent's link count unchanged.
>> >
>> > For example, renaming one of two sibling directories over the other
>> > leaves the parent with four links instead of three. stat and ls report
>> > the stale count, and find -links 3 does not match the parent.
>> >
>> > Drop the parent's link count for this case after the source entry has
>> > been removed successfully. Leave cross-parent renames, regular files
>> > and the existing error paths unchanged.
>> >
>> > Signed-off-by: Hungyu Lin <dennylin0707@gmail.com>
>>
>> Looks good. Thanks.
>>
>> Acked-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
>
> Thanks. Sashiko asked a thing:
> https://sashiko.dev/#/patchset/20261028211626.26103-1-dennylin0707@gmail.com
Hm, sure. It is possible what sashiko says. This patch itself should be
ok though.
Hungyu, can you add ->i_nlink check for corrupted dir?
Thanks.
--
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
prev parent reply other threads:[~2026-10-29 19:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-28 21:16 [PATCH] fat: fix parent link count when replacing a sibling directory Hungyu Lin
2026-10-29 5:57 ` OGAWA Hirofumi
2026-10-29 19:15 ` Andrew Morton
2026-10-29 19:59 ` OGAWA Hirofumi [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=874ie4tgzs.fsf@mail.parknet.co.jp \
--to=hirofumi@mail.parknet.co.jp \
--cc=akpm@linux-foundation.org \
--cc=brauner@kernel.org \
--cc=dennylin0707@gmail.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.