Skip to content

mgr/vol: improve readability and tell readers why return value is zero#63554

Closed
rishabh-d-dave wants to merge 1 commit intoceph:mainfrom
rishabh-d-dave:vols-remove-subvol
Closed

mgr/vol: improve readability and tell readers why return value is zero#63554
rishabh-d-dave wants to merge 1 commit intoceph:mainfrom
rishabh-d-dave:vols-remove-subvol

Conversation

@rishabh-d-dave
Copy link
Contributor

Fixes: https://tracker.ceph.com/issues/71469

Contribution Guidelines

  • To sign and title your commits, please refer to Submitting Patches to Ceph.

  • If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.

  • When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands

@rishabh-d-dave rishabh-d-dave requested a review from a team May 28, 2025 09:48
@rishabh-d-dave rishabh-d-dave changed the title mgr/vol: improve readability and tell readers why return value was zero mgr/vol: improve readability and tell readers why return value is zero May 28, 2025
@rishabh-d-dave
Copy link
Contributor Author

jenkins test make check arm64

@rishabh-d-dave
Copy link
Contributor Author

jenkins test api

Copy link
Contributor

@mchangir mchangir left a comment

Choose a reason for hiding this comment

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

LGTM

@rishabh-d-dave rishabh-d-dave added the wip-rishabh-testing Rishabh's testing label label May 29, 2025
ve = VolumeException(ve.errno, ve.error_str + " (use --force to override)")
ret = self.volume_exception_to_retval(ve)
elif not (ve.errno == -errno.ENOENT and force):
elif ve.errno == -errno.ENOENT and force:
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we really need to do it this way? Isn't it clear already with how the check looks now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it should be immediately evident to reader that it is by choice that subvolume rm is not idempotent BUT subvolume rm --force is. And the comment added below this line ensures that. And change this in line helps adding comment specifically for this case. Plus, having an explicit else also improve readability. Ofcourse readability is subjective and but being explicit for such cases is better IMO.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@vshankar The QA run was successful. Can we mark this thread as resolved and merge this PR?

Copy link
Contributor

Choose a reason for hiding this comment

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

As I said before, I don't find this change compelling. The bigger point is that this is not a good use of your time. And since this change was put to test even after I initially opposed it, I really do not have any further comments. Sorry!

Copy link
Contributor Author

@rishabh-d-dave rishabh-d-dave Jun 26, 2025

Choose a reason for hiding this comment

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

Cool, thanks for the reply. It was unclear that you wanted this PR closed. I put it to test it ddn't cost anything extra to put this to test along with other PRs.

@rishabh-d-dave
Copy link
Contributor Author

This PR is under test in https://tracker.ceph.com/issues/71663.

@rishabh-d-dave
Copy link
Contributor Author

This PR is under test in https://tracker.ceph.com/issues/71663.

A large number of jobs failed to an unrelated error, deferring QA run until it is fixed.

@rishabh-d-dave rishabh-d-dave added wip-rishabh-testing Rishabh's testing label and removed wip-rishabh-testing Rishabh's testing label labels Jun 16, 2025
@rishabh-d-dave
Copy link
Contributor Author

This PR is under test in https://tracker.ceph.com/issues/71703.

@rishabh-d-dave
Copy link
Contributor Author

@rishabh-d-dave
Copy link
Contributor Author

Closing this PR since this change isn't compelling.

@rishabh-d-dave rishabh-d-dave deleted the vols-remove-subvol branch July 31, 2025 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cephfs Ceph File System needs-review pybind wip-rishabh-testing Rishabh's testing label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants