Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gpt-auto-generator: Ignore zero sized block devices #26904

Closed
wants to merge 1 commit into from
Closed

gpt-auto-generator: Ignore zero sized block devices #26904

wants to merge 1 commit into from

Conversation

yaneti
Copy link

@yaneti yaneti commented Mar 20, 2023

e.g usb connected card readers with no card in them

Otherwise I get a little bit of ugliness on startup here with Fedora 37 like:

systemd-gpt-auto-generator[504]: Failed to dissect: Permission denied
(sd-executor)[497]: /usr/lib/systemd/system-generators/systemd-gpt-auto-generator failed with exit status 1.

e.g usb connected card readers with no card in them
@github-actions github-actions bot added the please-review PR is ready for (re-)review by a maintainer label Mar 20, 2023
@github-advanced-security
Copy link

You have successfully added a new shellcheck configuration differential-shellcheck. As part of the setup process, we have scanned this repository and found no existing alerts. In the future, you will see all code scanning alerts on the repository Security tab.

Comment on lines +748 to +749
r = read_one_line_file(p, &s);
if (r == 0 && !strcmp(s, "0")) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

read_one_line_file() returns the number of characters read. If the file is empty, this will be 0. The conditional, as written, cannot be true.

Did this get tested at all?

keszybz added a commit to keszybz/systemd that referenced this pull request Mar 21, 2023
@keszybz keszybz added ci-fails/needs-rework 🔥 Please rework this, the CI noticed an issue with the PR and removed please-review PR is ready for (re-)review by a maintainer labels Mar 21, 2023
@poettering
Copy link
Member

i don't get this.

we dissect the root disk from which the root fs is mounted. A zero-sized block device would not be backing your root fs, hence this PR looks wrong to me.

What made you think this as anything to do with an usb card reader?

Can you please provide logs of the issue you saw?

@poettering poettering added gpt-auto needs-reporter-feedback ❓ There's an unanswered question, the reporter needs to answer labels Mar 21, 2023
@yaneti
Copy link
Author

yaneti commented Mar 21, 2023

I think I know how I got this wrong:

  • systemd-251 in f37 does give off the errors mentioned above so I simply assumed it has something to do with the empty card reader
  • then produced the wrong patch but applied it to systemd-253 which I then tested on f37 to convince myself if fixes the issue, while apparently the issue was already fixed somewhere between 251 and 253

Sorry for the noise

@yaneti yaneti closed this Mar 21, 2023
@github-actions github-actions bot removed ci-fails/needs-rework 🔥 Please rework this, the CI noticed an issue with the PR needs-reporter-feedback ❓ There's an unanswered question, the reporter needs to answer labels Mar 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

None yet

3 participants