Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Is the check avail >= SIMPLEFS_MAX_EXTENTS actually necessary here?

Aperta
#81 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

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

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

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di sysprog21/simplefs

Tutte le issue di sysprog21/simplefs

Issue simili

Altre issue su C

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.