-
Notifications
You must be signed in to change notification settings - Fork 118
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
PWX-40172 (master): makes chattr ignore 'inappropriate ioctl' errors #2502
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Adam Krpan <[email protected]>
|
||
stderrStr := stderr.String() | ||
if isInappropriateIoctl(stderrStr) { // Returned in case of filesystem that does not support chattr | ||
return nil |
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.
Uh.. this override will unconditionally turn off the inappropriate ioctl for device
(also invalid argument while setting flags
) errors on chattr
for ALL PLATFORMS.
I wonder if we could avoid it?
Some suggestions that might work:
- have
AddImmutable()
return theinappropriate ioctl for device
error -- and let the caller handle the "error ignoring", or - extend the
AddImmutable()
by addingAddImmutable(..., errorsToIgnore []error)
and have the caller populate the "errors to ignore" list, or - have the
chattr
command "overrideable" -- so that the caller may change/override the OpenStorage'schattr
command with own implementation, before callingAddImmutable()
[or, mounting volume]
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.
Hmm.. I see that your comment above said "// Returned in case of filesystem that does not support chattr"
- so, I suppose you are making an argument that "chattr aways returns the ENOTTY when filesystem does not support the chattr'ing"
- my concern was that we'll also be masking the "legal errors" -- (maybe use a "wrong device" like perhaps
chattr /dev/stderr
) -- which is why I'd look for means to reduce the "blast radius" of this change, and limit it only to theSLE-Micro
Linux platform
Let's see of others from the team would have any comments / feedback
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.
That was my assumption (it always returns one of those two errors I linked), but I do not know that for sure and I agree that it would mask "legal" errors.
The "override" option seems the most feasible, especially because when we run that platform detection code we can have it also set perhaps IgnoreChattrIOCTLErrors = true
or something. Then the caller has the responsibility of knowing what cases that it matters in.
This PR is stale because it has been in review for 3 days with no activity. |
What this PR does / why we need it:
In some OSes like SLE Micro, the
/var
directory is mounted using an overlay filesystem. Something in this setup does not supportchattr
. In this case, we should just ignoreinappropriate ioctl for device
errors as there is nothing we can do.Which issue(s) this PR fixes (optional)
PWX-40172
Testing Notes