-
Notifications
You must be signed in to change notification settings - Fork 61
Preserve XFS quota options in temporary mounts #1132
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
Merged
vojtechtrefny
merged 2 commits into
storaged-project:master
from
vojtechtrefny:master_xfs-mount-quota
Oct 8, 2025
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -277,12 +277,12 @@ def clean_scsi_debug(scsi_debug_dev): | |
| def _wait_for_nvme_controllers_ready(subnqn, timeout=3): | ||
| """ | ||
| Wait for NVMe controllers with matching subsystem NQN to be in live state | ||
|
|
||
| :param str subnqn: subsystem nqn to match controllers against | ||
| :param int timeout: timeout in seconds (default: 3) | ||
| """ | ||
| start_time = time.time() | ||
|
|
||
| while time.time() - start_time < timeout: | ||
| try: | ||
| for ctrl_path in glob.glob("/sys/class/nvme/nvme*/"): | ||
|
|
@@ -297,12 +297,12 @@ def _wait_for_nvme_controllers_ready(subnqn, timeout=3): | |
| return | ||
| except: | ||
| continue | ||
|
|
||
| except: | ||
| pass | ||
|
|
||
| time.sleep(1) | ||
|
|
||
| os.system("udevadm settle") | ||
|
|
||
| def find_nvme_ctrl_devs_for_subnqn(subnqn, wait_for_ready=True): | ||
|
|
@@ -756,11 +756,18 @@ def run(cmd_string): | |
| return subprocess.call(cmd_string, close_fds=True, shell=True) | ||
|
|
||
|
|
||
| def mount(device, where, ro=False): | ||
| def mount(device, where, ro=False, options=None): | ||
| if not os.path.isdir(where): | ||
| os.makedirs(where) | ||
|
|
||
| if ro: | ||
| os.system("mount -oro %s %s" % (device, where)) | ||
| if options: | ||
| options += ",ro" | ||
| else: | ||
| options = "ro" | ||
|
|
||
| if options: | ||
| os.system("mount -o %s %s %s" % (options, device, where)) | ||
| else: | ||
| os.system("mount %s %s" % (device, where)) | ||
|
Comment on lines
+759
to
772
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using def mount(device, where, ro=False, options=None):
if not os.path.isdir(where):
os.makedirs(where)
mount_cmd = ["mount"]
if ro:
if options:
options += ",ro"
else:
options = "ro"
if options:
mount_cmd.extend(["-o", options])
mount_cmd.extend([device, where])
# Using subprocess.run is safer than os.system with string formatting.
# The original implementation ignored the return code, so we do the same.
subprocess.run(mount_cmd) |
||
|
|
||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This assertion is likely to fail. The log message will include other mount options like
nosuidandnodevappended to the quota options, so the full string will be something like... with options: uquota,gquota,pquota,nosuid,nodev. The substring you're checking for won't be found.To make the test more robust and accurate, you should check for the presence of each quota option individually.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, almost ;-)