mbox series

[v2,0/2] fat: add support for directories without . and .. entries

Message ID 20240625175133.922758-1-cascardo@igalia.com (mailing list archive)
Headers show
Series fat: add support for directories without . and .. entries | expand

Message

Thadeu Lima de Souza Cascardo June 25, 2024, 5:51 p.m. UTC
Some FAT filesystems do not have . and .. entries in some directories.
Currently, such filesystems are not mounted because such directories will
have no links. They are also corrupted as inodes are evicted and that leads
to such directories clusters being marked as freed. Later mounts will then
error out when finding such clusters.

These two commits allow those filesystems to be mounted and . and .. to
still appear when listing such directories.

v2:
- Also ignore the absence of . directory and always have at least two links.
- Add a second commit to always emit . and .. at readdir.

Thadeu Lima de Souza Cascardo (2):
  fat: ignore . and .. subdirs and always add links to dirs
  fat: always use dir_emit_dots and ignore . and .. entries

 fs/fat/dir.c   | 28 ++++++++++++----------------
 fs/fat/inode.c |  2 +-
 2 files changed, 13 insertions(+), 17 deletions(-)