mtd: SET loses the consolidation error and can report -ENOMEM

オープン 初心者向け
#22,316 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
62/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
c
領域
embedded-iot

調査の方向性

drivers/mtd/mtd_config.c の、730〜733行付近の統合ヘルパーとそのエラー戻り値から始め、次に戻り値を破棄している1000〜1003行、1313行、1328行付近の SET の呼び出し箇所を確認してください。ヘルパーの失敗を示す番兵値がどのように使われているか、また MTD の読み取り/書き込み/消去エラーを呼び出し元に返せるかを調べてください。統合中の I/O エラーが、再試行された検索の末に -ENOMEM で終わるのではなく、SET の呼び出し元に届けば完了です。

索引モデルが issue の本文から書いたものです。

説明

Mechanism. The consolidation helper returns 0 as its failure sentinel. SET ignores that value, retries the free-entry search, and can end up returning -ENOMEM even though the real failure was an I/O error during consolidation.

Effect. The caller sees a misleading -ENOMEM (or an apparently successful retry) instead of the underlying I/O failure, and the diagnostic information from the original error is lost.

Location. drivers/mtd/mtd_config.c:730-733, :1000-1003, :1313, :1328 (master f284e6d7).

Trigger. A consolidation pass during SET hits an MTD write/erase error.

Expected. The original I/O error reaches the caller.

Evidence. Source inspection only: both error returns yield 0, and both call sites discard the return value.

Patch. Return the underlying error from the consolidation helper and propagate it from SET.

主要言語
C
スター
4.1k
フォーク
1.8k
平均マージ
1日 17時間
マージ済み PR(30日)
900

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

apache/nuttx のほかの issue

apache/nuttx の issue をすべて見る

似ている issue

C の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。