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

drivers/overlay: Notify the user if the backing filesystem is not supported with OverlayFS #1374

Conversation

aarontomlin
Copy link

If the backing filesystem is not supported with OverlayFS as a container storage driver/or graph driver then do not continue. In this context, report the incompatibility by notifying the user of an unsupported configuration. The filesystem type/or ID that is returned by the statfs(2) system call is reported too, to assist further troubleshooting efforts. It can be used to deduce the actual filesystem used for the container storage graph directory.

Signed-off-by: Aaron Tomlin atomlin@redhat.com

Copy link
Member

@giuseppe giuseppe left a comment

Choose a reason for hiding this comment

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

good idea, could you fix the issue reported by the linter?

@aarontomlin aarontomlin force-pushed the atomlin-overlayfs-give-up-when-back-end-fs-is-unsupported branch from 2185716 to 1f72cb4 Compare September 30, 2022 09:02
@aarontomlin
Copy link
Author

good idea, could you fix the issue reported by the linter?

Done.

if fsName, ok := graphdriver.FsNames[fsMagic]; ok {
if fsName, ok := graphdriver.FsNames[fsMagic]; !ok {
return nil, errors.Wrapf(graphdriver.ErrIncompatibleFS, "filesystem type %#x reported for %s is not supported with 'overlay'", fsMagic, filepath.Dir(home))
} else {
Copy link
Member

Choose a reason for hiding this comment

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

Just remove the else { } block

and only have
backingFs=fsName

Should fix the lint complaint.

@@ -309,7 +310,9 @@ func Init(home string, options graphdriver.Options) (graphdriver.Driver, error)
if err != nil {
return nil, err
}
if fsName, ok := graphdriver.FsNames[fsMagic]; ok {
if fsName, ok := graphdriver.FsNames[fsMagic]; !ok {
return nil, errors.Wrapf(graphdriver.ErrIncompatibleFS, "filesystem type %#x reported for %s is not supported with 'overlay'", fsMagic, filepath.Dir(home))
Copy link
Member

Choose a reason for hiding this comment

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

Could you also use
fmt.Erorrf("filesystem type %#x reported for %s is not supported with 'overlay': %w", fsMagic, filepath.Dir(home), graphdriver.ErrIncompatibleFS)

Copy link
Author

Choose a reason for hiding this comment

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

Done. Thanks Daniel.

@aarontomlin aarontomlin force-pushed the atomlin-overlayfs-give-up-when-back-end-fs-is-unsupported branch 2 times, most recently from 2f32b4b to 6e4927e Compare September 30, 2022 10:43
@aarontomlin aarontomlin requested review from rhatdan and giuseppe and removed request for rhatdan and giuseppe September 30, 2022 10:43
@rhatdan
Copy link
Member

rhatdan commented Sep 30, 2022

LGTM
Thanks @aarontomlin

}
backingFs = fsName
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please move this to an else block, since fsName does not exists outside of the scope.

Copy link
Author

Choose a reason for hiding this comment

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

I modified the code so lint will be happy.

Copy link
Member

Choose a reason for hiding this comment

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

Oops that was my fault.

@aarontomlin aarontomlin force-pushed the atomlin-overlayfs-give-up-when-back-end-fs-is-unsupported branch from e9a4ec1 to 722edb1 Compare September 30, 2022 11:22
@aarontomlin aarontomlin requested review from flouthoc and removed request for rhatdan September 30, 2022 11:22
…ported with OverlayFS

If the backing filesystem is not supported with OverlayFS as a container
storage driver/or graph driver then do not continue.
In this context, report the incompatibility by notifying the user of an
unsupported configuration. The filesystem type/or ID that is returned by
the statfs(2) system call is reported too, to assist further
troubleshooting efforts. It can be used to deduce the actual filesystem
used for the container storage graph directory.

Signed-off-by: Aaron Tomlin <atomlin@redhat.com>
@aarontomlin aarontomlin force-pushed the atomlin-overlayfs-give-up-when-back-end-fs-is-unsupported branch from 722edb1 to d9da335 Compare September 30, 2022 11:28
@rhatdan rhatdan merged commit fb9a8ea into containers:main Sep 30, 2022
@giuseppe
Copy link
Member

good idea, could you fix the issue reported by the linter?

so I disagree with my assessment from some months ago. I think it is better if we revert, or do not make it a failure as it is hiding valid use cases: #1546

giuseppe added a commit to giuseppe/storage that referenced this pull request Mar 31, 2023
The overlay driver previously raised an error when encountering an
unsupported filesystem. This commit changes the error message to a
debug log, allowing the overlay driver to continue its operation even
with unsupported filesystems, without causing a failure.

[NO NEW TESTS NEEDED]

Introduced-by: containers#1374

Closes: containers#1546

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
@tis-rpage
Copy link

good idea, could you fix the issue reported by the linter?

so I disagree with my assessment from some months ago. I think it is better if we revert, or do not make it a failure as it is hiding valid use cases: #1546

I believe the failure condition is reasonable, however I recommend adding a flag at a minimum to ignore the check and let users own the tool failing by using some --i-acknowledge-overlayfs-support-is-good-but-i-dont-care

@giuseppe
Copy link
Member

giuseppe commented Apr 3, 2023

no there is no need to fail just because we don't know the file system. At most, we can fail/raise warning if we know something won't work correctly

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.

None yet

5 participants