Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fat: ignore . and .. subdirs and always add links to dirs
The tools used for creating images for the Lego Mindstrom EV3 are not adding '.' and '..' entry in the 'Projects' directory. Without this fix, the kernel can not fill the inode structure for 'Projects' directory. See microsoft/pxt-ev3#980 And microsoft/uf2-linux#6 When counting the number of subdirs, ignore . and .. subdirs and add two when setting the initial link count for directories. This way, the number of links is always correctly accounted for. With this fix applied, we can mount an image with such empty directories, access them, create subdirectories and remove them. This also prevents corrupting such filesystems as when the inodes would be put, since no links were accounted for, all of its clusters would be marked as free. Signed-off-by: Thadeu Lima de Souza Cascardo <[email protected]> Cc: Gwendal Grignou <[email protected]> Link: https://lore.kernel.org/all/[email protected]/ Cc: [email protected]
- Loading branch information