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

test: update permissions of DAX devices after clearing bad blocks #5611

Conversation

ldorau
Copy link
Member

@ldorau ldorau commented Apr 26, 2023

The "sudo ndctl clear-errors" command resets permissions of DAX block device and its resource files,
because it removes the old files and creates new ones with default permissions, so their permissions have to be updated.

Fixes: #5606


This change is Reviewable

Copy link
Contributor

@grom72 grom72 left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 1 of 1 files at r1, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @ldorau)

@ldorau ldorau marked this pull request as ready for review April 26, 2023 11:27
Copy link
Contributor

@osalyk osalyk left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 1 of 1 files at r1, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @ldorau)

Copy link
Contributor

@grom72 grom72 left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @ldorau)

@codecov
Copy link

codecov bot commented Apr 26, 2023

Codecov Report

Merging #5611 (b207bcd) into stable-1.13 (705eca0) will decrease coverage by 0.01%.
The diff coverage is n/a.

@@               Coverage Diff               @@
##           stable-1.13    #5611      +/-   ##
===============================================
- Coverage        74.26%   74.25%   -0.01%     
===============================================
  Files              145      145              
  Lines            22131    22131              
  Branches          3704     3705       +1     
===============================================
- Hits             16435    16433       -2     
- Misses            5696     5698       +2     

@ldorau ldorau force-pushed the test-update-permissions-of-DAX-devices-after-clearing-bad-blocks branch from 383f440 to d89bab5 Compare April 27, 2023 07:25
@ldorau
Copy link
Member Author

ldorau commented Apr 27, 2023

Added "Ref: #5606" to the commit message.

@janekmi janekmi added this to the 1.13 on GHA milestone Apr 27, 2023
@ldorau ldorau force-pushed the test-update-permissions-of-DAX-devices-after-clearing-bad-blocks branch from d89bab5 to 04566b9 Compare April 27, 2023 10:05
@ldorau ldorau changed the base branch from master to stable-1.13 April 27, 2023 10:06
@ldorau
Copy link
Member Author

ldorau commented Apr 27, 2023

Rebased to pmem:stable-1.13.

Copy link
Contributor

@grom72 grom72 left a comment

Choose a reason for hiding this comment

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

Reviewed all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @ldorau)

Copy link
Contributor

@janekmi janekmi left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r1, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @ldorau)


src/test/unittest/badblock.py line 113 at r2 (raw file):

            # because it removes the old files and creates new ones
            # with default permissions, so their permissions
            # have to be updated.

updated -> restored?

Please see the comment below.


src/test/unittest/badblock.py line 119 at r2 (raw file):

            futils.run_command("sudo chmod a+r {}".format(resources),
                               "failed to change permissions "
                               "of DAX devices' resources")

I thought about reading the permissions before calling the culprit command and using the output to restore the permissions as if they were before calling the command.

Would it be that much more complex?

@ldorau ldorau requested a review from janekmi May 4, 2023 14:39
Copy link
Member Author

@ldorau ldorau left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @janekmi)


src/test/unittest/badblock.py line 113 at r2 (raw file):

Previously, janekmi (Jan Michalski) wrote…

updated -> restored?

Please see the comment below.

updated -> fixed ?


src/test/unittest/badblock.py line 119 at r2 (raw file):

Previously, janekmi (Jan Michalski) wrote…

I thought about reading the permissions before calling the culprit command and using the output to restore the permissions as if they were before calling the command.

Would it be that much more complex?

I'm sure it would be much more complex. There can be a lot of those files. How do you want to do that? Is it worth this effort? I doubt.

Copy link
Contributor

@janekmi janekmi left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @ldorau)


src/test/unittest/badblock.py line 113 at r2 (raw file):
What would you say to write it down as follows:

The "sudo ndctl clear-errors" command resets permissions of the DAX block device and its resource files because it removes the old files and creates new ones with default permissions which interrupts further test execution. The following commands set permissions which should allow further test execution to work around this issue.


src/test/unittest/badblock.py line 119 at r2 (raw file):

Previously, ldorau (Lukasz Dorau) wrote…

I'm sure it would be much more complex. There can be a lot of those files. How do you want to do that? Is it worth this effort? I doubt.

Alright. You convinced me. 😆 I think I have to find a way to cut the corners in general to address everything we currently got on our plate. 👍

@ldorau ldorau force-pushed the test-update-permissions-of-DAX-devices-after-clearing-bad-blocks branch from 04566b9 to 453f983 Compare May 5, 2023 06:46
@ldorau ldorau requested review from grom72, janekmi and osalyk May 5, 2023 06:47
Copy link
Member Author

@ldorau ldorau left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @grom72, @janekmi, and @osalyk)


src/test/unittest/badblock.py line 113 at r2 (raw file):

Previously, janekmi (Jan Michalski) wrote…

What would you say to write it down as follows:

The "sudo ndctl clear-errors" command resets permissions of the DAX block device and its resource files because it removes the old files and creates new ones with default permissions which interrupts further test execution. The following commands set permissions which should allow further test execution to work around this issue.

Done.

Copy link
Contributor

@osalyk osalyk left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r3, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @grom72 and @janekmi)

Copy link
Member

@lukaszstolarczuk lukaszstolarczuk left a comment

Choose a reason for hiding this comment

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

👍

Reviewed 1 of 1 files at r3, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @grom72 and @janekmi)

The "sudo ndctl clear-errors" command resets permissions
of the DAX block device and its resource files
because it removes the old files and creates new ones
with default permissions which interrupts further test execution.
The following commands set permissions which should allow
further test execution to work around this issue.

Ref: pmem#5606

Signed-off-by: Lukasz Dorau <lukasz.dorau@intel.com>
@ldorau ldorau force-pushed the test-update-permissions-of-DAX-devices-after-clearing-bad-blocks branch from 453f983 to b207bcd Compare May 5, 2023 08:36
Copy link
Contributor

@janekmi janekmi left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 1 of 1 files at r3, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @grom72)

@janekmi janekmi merged commit 23b1f90 into pmem:stable-1.13 May 5, 2023
@ldorau ldorau deleted the test-update-permissions-of-DAX-devices-after-clearing-bad-blocks branch May 8, 2023 08:36
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.

pmem2_badblock/TEST1
5 participants