Skip to content

fix(sysfs): add check for empty devpath#560

Merged
kmova merged 3 commits intoopenebs-archive:masterfrom
akhilerm:fix-empty-sysfs-device
Apr 5, 2021
Merged

fix(sysfs): add check for empty devpath#560
kmova merged 3 commits intoopenebs-archive:masterfrom
akhilerm:fix-empty-sysfs-device

Conversation

@akhilerm
Copy link
Copy Markdown
Contributor

@akhilerm akhilerm commented Apr 1, 2021

Signed-off-by: Akhil Mohan akhil.mohan@mayadata.io

Why is this PR required? What issue does it fix?:
If the devpath received due to some error is empty, then sysfs device creation caused a crash. This PR adds a check for empty path before creating a sysfs device.

What this PR does?:

  • adds check for empty device path

Does this PR require any upgrade changes?:
No

If the changes in this PR are manually verified, list down the scenarios covered::

Any additional information for your reviewer? :
Mention if this PR is part of any design or a continuation of previous PRs

Checklist:

akhilerm added 3 commits April 1, 2021 19:39
Signed-off-by: Akhil Mohan <akhil.mohan@mayadata.io>
Signed-off-by: Akhil Mohan <akhil.mohan@mayadata.io>
Signed-off-by: Akhil Mohan <akhil.mohan@mayadata.io>
@akhilerm akhilerm requested a review from kmova April 1, 2021 14:17
@codecov-io
Copy link
Copy Markdown

Codecov Report

Merging #560 (7fe55e9) into master (ef2bb97) will decrease coverage by 0.86%.
The diff coverage is 66.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #560      +/-   ##
==========================================
- Coverage   49.39%   48.52%   -0.87%     
==========================================
  Files          73       73              
  Lines        3365     3367       +2     
==========================================
- Hits         1662     1634      -28     
- Misses       1548     1578      +30     
  Partials      155      155              
Impacted Files Coverage Δ
pkg/sysfs/device.go 27.27% <66.66%> (+27.27%) ⬆️
cmd/ndm_daemonset/probe/eventhandler.go 40.00% <0.00%> (-10.91%) ⬇️
cmd/ndm_daemonset/probe/addhandler.go 71.13% <0.00%> (-6.19%) ⬇️
cmd/ndm_daemonset/probe/udevprobe.go 63.12% <0.00%> (-3.92%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ef2bb97...7fe55e9. Read the comment docs.

@kmova kmova merged commit aac37c4 into openebs-archive:master Apr 5, 2021
@akhilerm akhilerm deleted the fix-empty-sysfs-device branch December 13, 2021 05:47
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.

openebs-ndm crashing on restart after block device resize

5 participants