Re: [PATCH] exfat: fix parent link count when replacing a sibling directory

From: Namjae Jeon

Date: Thu Oct 29 2026 - 04:15:25 EST


On Thu, Oct 29, 2026 at 5:33 AM Hungyu Lin <dennylin0707@xxxxxxxxx> wrote:
>
> exfat_rename() adjusts parent link counts only when a directory moves
> between different parents. Replacing an existing empty directory in the
> same parent also removes one 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.
>
> Also adjust the parent count when a target inode exists in the directory
> rename case. Keep same-parent renames without replacement and the
> existing cross-parent accounting unchanged.
>
> Fixes: 5f2aa075070c ("exfat: add inode operations")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Hungyu Lin <dennylin0707@xxxxxxxxx>
Applied it to #dev.
Thanks!