File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -62,9 +62,10 @@ static int simplefs_iterate(struct file *dir, struct dir_context *ctx)
6262 for (; remained_nr_files && ei < SIMPLEFS_MAX_EXTENTS ; ei ++ ) {
6363 if (eblock -> extents [ei ].ee_start == 0 )
6464 continue ;
65-
65+ int ei_nr = eblock -> extents [ ei ]. nr_files ;
6666 /* Iterate over blocks in one extent */
67- for (bi = 0 ; bi < eblock -> extents [ei ].ee_len && remained_nr_files ;
67+ for (bi = 0 ;
68+ bi < eblock -> extents [ei ].ee_len && remained_nr_files && ei_nr ;
6869 bi ++ ) {
6970 bh2 = sb_bread (sb , eblock -> extents [ei ].ee_start + bi );
7071 if (!bh2 ) {
@@ -86,6 +87,7 @@ static int simplefs_iterate(struct file *dir, struct dir_context *ctx)
8687 offset -- ;
8788 } else {
8889 remained_nr_files -- ;
90+ ei_nr -- ;
8991 if (!dir_emit (ctx , dblock -> files [fi ].filename ,
9092 SIMPLEFS_FILENAME_LEN ,
9193 dblock -> files [fi ].inode , DT_UNKNOWN )) {
You can’t perform that action at this time.
0 commit comments