Skip to content

mount: create proper mounter for OpenBSD#59

Merged
kolyshkin merged 1 commit intomoby:masterfrom
yukiisbored:yuki_is_bored/openbsd_mounter
Feb 24, 2021
Merged

mount: create proper mounter for OpenBSD#59
kolyshkin merged 1 commit intomoby:masterfrom
yukiisbored:yuki_is_bored/openbsd_mounter

Conversation

@yukiisbored
Copy link
Copy Markdown
Contributor

@yukiisbored yukiisbored commented Dec 18, 2020

This is made for the sysutils/docker-cli port which I maintain, as moby/sys is part of the vendored libraries for docker/cli.

While I could stub this out (the same way as how it is on darwin and windows), I decided to actually write a proper mounter since it seems there's intention to actually bring OpenBSD support (as seen in cb807b1).

OpenBSD's mount(2) works differently since it uses separate structs to present options for different filesystems, unlike in FreeBSD. It also means that support for other filesystems need to be added explicitly. I'm not sure which ones are required for now so I just write support for only FFS, which is the go-to filesystem used by OpenBSD systems.

Copy link
Copy Markdown
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

Thanks!

Could you perhaps include this as the commit message ? (Perhaps also a note/comment in the code to explain that more filesystems can be added in future, but I'm ok with skipping that if it's adding too much noise in the code)

OpenBSD's mount(2) works differently since it uses separate structs to present
options for different filesystems, unlike in FreeBSD. It also means that support
for other filesystems need to be added explicitly. I'm not sure which ones are
required for now so I just write support for only FFS, which is the go-to
filesystem used by OpenBSD systems.

@yukiisbored yukiisbored force-pushed the yuki_is_bored/openbsd_mounter branch from 6e3871a to fa637b3 Compare January 4, 2021 14:46
Copy link
Copy Markdown
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@thaJeztah
Copy link
Copy Markdown
Member

@cpuguy83 @kolyshkin PTAL

Comment thread mount/mounter_openbsd.go Outdated
Comment thread mount/mounter_openbsd.go Outdated
Comment thread mount/mounter_openbsd.go Outdated
@kolyshkin
Copy link
Copy Markdown
Collaborator

@yukiisbored thanks for your contribution, I left a few review comments.

OpenBSD's mount(2) works differently since it uses separate structs to
present options for different filesystems, unlike in FreeBSD. It also
means that support for other filesystems need to be added explicitly.

I'm not sure which ones are required for now so I just write support
for only FFS, which is the go-to filesystem used by OpenBSD systems.

Signed-off-by: Muhammad Kaisar Arkhan <[email protected]>
@yukiisbored yukiisbored force-pushed the yuki_is_bored/openbsd_mounter branch from fa637b3 to eff8446 Compare January 5, 2021 12:58
@yukiisbored yukiisbored requested a review from kolyshkin January 8, 2021 21:38
@thaJeztah
Copy link
Copy Markdown
Member

@kolyshkin looks like the PR was updated; PTAL

Comment thread mount/mounter_openbsd.go
source: device,
target: target,
flags: flag,
err: fmt.Errorf("unsupported file system type: %s", mType),
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'd use string concatenation here (it's a bit faster):

Suggested change
err: fmt.Errorf("unsupported file system type: %s", mType),
err: errors.New("unsupported file system type: " + mType),

but feel free to ignore (not that this is a hot path)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

😉😇 #59 (comment)

Copy link
Copy Markdown
Collaborator

@kolyshkin kolyshkin left a comment

Choose a reason for hiding this comment

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

LGTM

@kolyshkin kolyshkin merged commit 4fda0b7 into moby:master Feb 24, 2021
@thaJeztah
Copy link
Copy Markdown
Member

Thanks!!

@thaJeztah thaJeztah changed the title Create proper mounter for OpenBSD mount: create proper mounter for OpenBSD Nov 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants