Conversation
1. Root cause: doBurn() calls Xorriso_option_commit() without prior
blank initialization, CD-RW media PMA/TOC not properly initialized
causes Write(10) failure on USB optical drives
2. Fix: add Xorriso_option_blank("as_needed") before commit in doBurn(),
consistent with doWriteISO() and doErase() which already use
blank=as_needed
3. Impact: blank=as_needed is no-op for blank/appendable media, only
initializes rewritable media that needs it, no regression for
existing burn paths
Log: Fix CD-RW disc burning failure on USB optical drives
Influence:
1. Test CD-RW burning with USB external optical drive
2. Test DVD+RW burning to ensure no regression
3. Test CD-R burning to ensure blank=as_needed has no side effect
4. Test appendable burning (multi-session) scenarios
fix: 刻录前添加blank=as_needed修复CD-RW刻录失败
1. 根因:doBurn()直接调用Xorriso_option_commit()但未先执行blank
初始化,CD-RW光盘PMA/TOC未正确初始化导致USB光驱Write(10)失败
2. 方案:在doBurn()的commit之前添加Xorriso_option_blank("as_needed"),
与doWriteISO()和doErase()中已有的blank=as_needed行为一致
3. 影响:blank=as_needed对空白/可追加介质无操作,仅初始化需要空白化
的可重写介质,对现有刻录路径无回归
Log: 修复USB外置光驱刻录CD-RW光盘失败的问题
Influence:
1. 测试USB外置光驱刻录CD-RW光盘
2. 测试DVD+RW刻录确认无回归
3. 测试CD-R刻录确认blank=as_needed无副作用
4. 测试多会话追加刻录场景
PMS: BUG-318189
Reviewer's guide (collapsed on small PRs)Reviewer's GuideFixes CD-RW burning failures on USB optical drives by adding an as-needed blanking step before the xorriso commit operation, while preserving behavior for blank, appendable, and non-rewritable media. Sequence diagram for CD-RW file burning initializationsequenceDiagram
participant DOpticalDiscManager
participant DXorrisoEngine
participant Xorriso
participant OpticalDrive
DOpticalDiscManager->>DXorrisoEngine: doBurn(files, speed, ...)
DXorrisoEngine->>Xorriso: Xorriso_option_blank(as_needed)
Xorriso->>OpticalDrive: Initialize rewritable media PMA/TOC
OpticalDrive-->>Xorriso: Initialization result
alt blanking succeeds
DXorrisoEngine->>Xorriso: Xorriso_option_commit()
Xorriso->>OpticalDrive: Write disc data
OpticalDrive-->>Xorriso: Burn result
else blanking fails
DXorrisoEngine-->>DOpticalDiscManager: false
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: liyigang1 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
deepin pr auto review🤖 AI 代码审查报告📊 总体评价
🔍 详细分析1. 语法逻辑 ✅评价: 优秀 ✅ 通过 潜在问题: 建议: [] 2. 代码质量 ✅评价: 优秀 ✅ 通过 潜在问题: 建议: [] 3. 代码性能 ✅评价: 优秀 ✅ 通过 潜在问题: 建议: [] 4. 代码安全 🔒评价: 优秀 ✅ 通过
安全漏洞详情: 建议: [] 💡 改进建议代码示例// 暂无代码示例本报告由 AI 代码审查工具自动生成 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Root Cause Analysis
CD-RW disc burning fails on USB external optical drives while the same CD-RW burns normally on internal drives and DVD+RW burns normally on the same USB drive. The root cause is that
doBurn()(file burning path) callsXorriso_option_commit()directly without a priorblank=as_neededinitialization step. Without this step, CD-RW media PMA/TOC is not properly initialized, causing the USB drive's Write(10) command to fail withDID_ERRORafter a 10-second timeout, followed by a device reset.Key evidence:
dxorrisoengine.cpp—doBurn()has noblankcall whiledoWriteISO()passesblank=as_neededvia cdrecord anddoErase()usesXorriso_option_blank("as_needed"); dmesg showsWrite(10) hostbyte=DID_ERROR cmd_age=10sfollowed by device reset on the USB drive.Fix
Added
Xorriso_option_blank(xorriso, "as_needed", 0)beforeXorriso_option_commit()indoBurn(), making it consistent withdoWriteISO()anddoErase()which already useblank=as_needed. Theas_neededmode is a no-op for blank/appendable media and only initializes rewritable media that needs it, so there is no side effect on existing burn paths. Change is 7 lines in a single file.Change Safety Assessment
Code Safety
doBurn()) was part of the initial implementation (2022-02-11) and has never been modified by any subsequent bug fix — this change does not revert any historical fixblank=as_neededis an established pattern already used indoErase()(line 301) anddoWriteISO()(via cdrecord); only callerDOpticalDiscManager::commit()is unaffected as the function signature is unchangedBusiness Impact Scope
Affected module: optical disc file burning (
DOpticalDiscManager::commit()→DXorrisoEngine::doBurn()). User-facing scenario: burning files to disc via file manager. The fix adds a necessary media initialization step before burning; no visible change to user workflow. Only CD-RW media on USB drives that previously failed will now succeed; all other media types (DVD+RW, CD-R, DVD-R) are unaffected.Verification Suggestion
Regression test priority: (1) CD-RW burning on USB external drive (original bug scenario), (2) DVD+RW burning to confirm no regression, (3) CD-R one-time burning to confirm
blank=as_neededhas no side effect, (4) multi-session appendable burning.根因分析
CD-RW光盘使用USB外置光驱刻录失败,但同一CD-RW在内置光驱上刻录正常,同一USB光驱刻录DVD+RW也正常。根因是
doBurn()(文件刻录路径)直接调用Xorriso_option_commit()而未先执行blank=as_needed初始化步骤。缺少此步骤导致CD-RW光盘PMA/TOC未正确初始化,USB光驱执行Write(10)命令时10秒超时后以DID_ERROR失败,随后触发设备重置。关键证据:
dxorrisoengine.cpp—doBurn()无blank调用,而doWriteISO()通过cdrecord传入blank=as_needed,doErase()使用Xorriso_option_blank("as_needed");dmesg显示Write(10) hostbyte=DID_ERROR cmd_age=10s后USB光驱设备重置。修复方案
在
doBurn()的Xorriso_option_commit()之前添加Xorriso_option_blank(xorriso, "as_needed", 0),与doWriteISO()和doErase()中已有的blank=as_needed行为一致。as_needed模式对空白/可追加介质无操作,仅初始化需要空白化的可重写介质,对现有刻录路径无副作用。改动为单文件7行。改动安全评估
代码安全评估
doBurn()的 commit 区段)属于初始实现(2022-02-11),此后未经历任何bug修复改动——本次改动不会撤销任何历史修复blank=as_needed是代码库中已建立的成熟模式,doErase()(第301行)和doWriteISO()(通过cdrecord)均已使用;唯一调用者DOpticalDiscManager::commit()不受影响,函数签名未改变业务影响范围
受影响模块:光盘文件刻录(
DOpticalDiscManager::commit()→DXorrisoEngine::doBurn())。用户场景:通过文件管理器将文件刻录到光盘。修复在刻录前添加必要的介质初始化步骤,用户操作流程无可见变化。仅CD-RW + USB光驱组合下此前失败的场景将恢复正常,其他介质类型(DVD+RW、CD-R、DVD-R)不受影响。验证建议
回归测试优先级:(1) USB外置光驱刻录CD-RW光盘(原始bug场景),(2) DVD+RW刻录确认无回归,(3) CD-R一次性刻录确认
blank=as_needed无副作用,(4) 多会话追加刻录场景。PMS: BUG-318189
Summary by Sourcery
Bug Fixes: