Skip to content

fix: [Stroage-interface] The interface show error.#160

Merged
deepin-bot[bot] merged 1 commit into
linuxdeepin:release/1071from
GongHeng2017:202507151439-1071-fixUFS
Jul 21, 2025
Merged

fix: [Stroage-interface] The interface show error.#160
deepin-bot[bot] merged 1 commit into
linuxdeepin:release/1071from
GongHeng2017:202507151439-1071-fixUFS

Conversation

@GongHeng2017
Copy link
Copy Markdown
Contributor

@GongHeng2017 GongHeng2017 commented Jul 15, 2025

-- In the special platform, the stroage interface show error.

Summary by Sourcery

Improve storage interface detection by matching spec_version substrings and supporting UFS 3.0, 3.1, and 4.0

Bug Fixes:

  • Fix storage interface error by replacing direct equality check with substring matching on spec_version

Enhancements:

  • Add support for UFS 4.0 interface detection

-- In the special platform, the stroage interface show error.
@deepin-ci-robot
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: GongHeng2017

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented Jul 15, 2025

Reviewer's Guide

Enhanced UFS interface detection by refactoring spec_version checks and adding support for UFS 4.0 in DeviceStorage::getDiskInfoInterface.

Class diagram for updated DeviceStorage::getDiskInfoInterface method

classDiagram
    class DeviceStorage {
        +void getDiskInfoInterface(const QString &devicePath, QString &interface)
    }
    class Utils {
        +static QString readContent(QString path)
    }
    DeviceStorage --> Utils : uses
Loading

File-Level Changes

Change Details Files
Refactor spec_version logic to support multiple UFS versions
  • Guard spec_version non-empty check with braces
  • Replace direct equality checks with contains() for version matching
  • Add branch to detect UFS 4.0 when spec_version contains "400"
  • Adjust existing UFS 3.0 and 3.1 detection to use substring matching
service/diskoperation/DeviceStorage.cpp

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@deepin-ci-robot
Copy link
Copy Markdown

deepin pr auto review

关键摘要:

  • 代码中使用了contains方法来比较版本号,这可能会导致误判,例如当spec_version包含"3000"时,也会被误认为是"UFS 3.0"。
  • spec_version的比较逻辑应该使用字符串的相等性比较,而不是包含关系。

是否建议立即修改:

@GongHeng2017
Copy link
Copy Markdown
Contributor Author

/forcemerge

@deepin-bot deepin-bot Bot merged commit cf06ef3 into linuxdeepin:release/1071 Jul 21, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants