fs/smartfs/smartfs_smart.c: Current sector should have a space for next entry size. If not, we should move to next sector.

This commit is contained in:
EunBong Song
2018-09-14 06:36:55 -06:00
committed by Gregory Nutt
parent a04d2eeb10
commit a279815434
+1 -1
View File
@@ -1306,7 +1306,7 @@ static int smartfs_readdir(struct inode *mountpt, struct fs_dirent_s *dir)
/* Now advance to the next entry */
dir->u.smartfs.fs_curroffset += entrysize;
if (dir->u.smartfs.fs_curroffset >= fs->fs_llformat.availbytes)
if (dir->u.smartfs.fs_curroffset + entrysize >= fs->fs_llformat.availbytes)
{
/* We advanced past the end of the sector. Go to next sector */