From 95af40ca57935281ee511fd199661945d5c3d07a Mon Sep 17 00:00:00 2001 From: andrey280 <43999980+andrey280@users.noreply.github.com> Date: Thu, 16 Jul 2026 11:57:30 +0300 Subject: [PATCH] e2fsck exit codes respect --- manila/share/drivers/generic.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/manila/share/drivers/generic.py b/manila/share/drivers/generic.py index 7a74b0310a..16ffa9f475 100644 --- a/manila/share/drivers/generic.py +++ b/manila/share/drivers/generic.py @@ -387,8 +387,9 @@ def _mount_device_with_lock(): # effect only after it was mounted. Closes #1645751 # NOTE(gouthamr): Executing tune2fs -U only works on # a recently checked filesystem. See debian bug 857336 - '&&', 'sudo', 'e2fsck', '-y', '-f', device_path, - '&&', 'sudo', 'tune2fs', '-U', 'random', device_path, + '&&', '(', 'sudo', 'e2fsck', '-y', '-f', device_path, + '||', '[', '$?', '-le', '2', ']', ')', + '&&', 'sudo', 'tune2fs', '-U', 'random', device_path, '&&', 'sudo', 'mount', device_path, mount_path, ) self._ssh_exec(server_details, mount_cmd)