diff options
| author | Hungyu Lin <dennylin0707@gmail.com> | 2026-10-30 06:00:11 +0000 |
|---|---|---|
| committer | Andrew Morton <akpm@linux-foundation.org> | 2026-11-02 19:18:58 -0800 |
| commit | 6cd4c2736c659397bd6c6d9e3cffd8211afcb60b (patch) | |
| tree | 8ebdf84c434789d0f92e0838ea50b6fdc3293b16 /tools/perf/scripts/python | |
| parent | 0988f0c0c7c908f0ff77fd8b90ce9918a1f41479 (diff) | |
fat: fix parent link count when replacing a sibling directory
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.
Share the parent link count check with rmdir through fat_dir_drop_nlink().
Only decrement counts of at least three and report a filesystem error
otherwise, rather than reducing a corrupted directory's count below two.
Export the helper for the VFAT and MSDOS modules.
Link: https://lore.kernel.org/20261030060011.70237-1-dennylin0707@gmail.com
Signed-off-by: Hungyu Lin <dennylin0707@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Cc: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions
