Is the check avail >= SIMPLEFS_MAX_EXTENTS actually necessary here?
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 48/100
- Tipo di issue
- Refactoring
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Tranquilla
- Stack tecnologico
- c, linux
- Ambito
- operating-systems
Direzione di ricerca
Inspect simplefs_create and simplefs_get_available_ext_idx, then trace how eblock->nr_files and avail are updated across the relevant directory operations. Determine whether SIMPLEFS_MAX_EXTENTS can be exceeded despite the existing SIMPLEFS_MAX_SUBFILES check; done means reaching a justified decision about retaining or removing the boundary check and validating the affected filesystem behavior.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
The purpose of this check is to prevent avail from going out of bounds, but I think it may not be necessary.
/* Validate avail index is within bounds */
if (avail >= SIMPLEFS_MAX_EXTENTS) {
ret = -EMLINK;
goto iput;
}
Whenever functions like "simplefs_create" are called, we already validate the maximum number of files with:
if (eblock->nr_files == SIMPLEFS_MAX_SUBFILES)
If this check passes, it means there is guaranteed to be space for creating a new object under this directory. Therefore, simplefs_get_available_ext_idx() should never return an out-of-bound value, and this boundary check appears redundant.
- Lingua principale
- C
- Stelle
- 495
- Fork
- 110
- Merge medio
- 26m
- PR unite (30g)
- 1
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di sysprog21/simplefs
-
Implement journaling supportForse di nuovo libera @HotMercury l’ha presa 892 giorni fa e non c’è nessuna pull request aperta. Aperta
Tutte le issue di sysprog21/simplefs
Issue simili
-
backlog bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
EchoTools/nevr-runtime#653 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
InfiniTimeOrg/InfiniTime#2492 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
I maintainer di solito rispondono entro 1 giorno
-
base-files: 82_config_generate: regenerate /etc/board.json if 0-bytes / truncated after power cutAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
openwrt/openwrt#25940 · 5 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
extension-modules topic-socket type-bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
python/cpython#159561 · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno