diff --git a/fs/fat/dir.c b/fs/fat/dir.c index 931dd28b5289..140fc39e2307 100644 --- a/fs/fat/dir.c +++ b/fs/fat/dir.c @@ -373,9 +373,10 @@ int fat_search_long(struct inode *inode, const unsigned char *name, if (de->attr == ATTR_EXT) { int status = fat_parse_long(inode, &cpos, &bh, &de, &unicode, &nr_slots); - if (status < 0) - return status; - else if (status == PARSE_INVALID) + if (status < 0) { + err = status; + goto end_of_dir; + } else if (status == PARSE_INVALID) continue; else if (status == PARSE_NOT_LONGNAME) goto parse_record;