Преглед изворни кода

Fixed inverted dir->count check logic

Curiously, the logic from 48bd2bf was incorrect, and would allow a
commit to be tried if erased _or_ dir->count was at risk of overflow.

That is clearly wrong, we should only try to commit if both conditions
are met...

Found again by dschendt
Christopher Haster пре 11 месеци
родитељ
комит
4cd2bfc2c1
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      lfs.c

+ 1 - 1
lfs.c

@@ -2264,7 +2264,7 @@ static int lfs_dir_relocatingcommit(lfs_t *lfs, lfs_mdir_t *dir,
         }
     }
 
-    if (dir->erased || dir->count >= 0xff) {
+    if (dir->erased && dir->count < 0xff) {
         // try to commit
         struct lfs_commit commit = {
             .block = dir->pair[0],