diff --git a/fs/fat/dir.c b/fs/fat/dir.c index 4afc4d9..7f66a38 100644 --- a/fs/fat/dir.c +++ b/fs/fat/dir.c @@ -586,8 +586,12 @@ static int __fat_readdir(struct inode *inode, struct file *file, bh = NULL; get_new: - if (fat_get_entry(inode, &cpos, &bh, &de) == -1) + if (fat_get_entry(inode, &cpos, &bh, &de) == -1) { + if (cpos == 0) + cpos = 2; + goto end_of_dir; + } parse_record: nr_slots = 0; /*