runc icon indicating copy to clipboard operation
runc copied to clipboard

libcontainer: the fstype argument is ignored for bind mount

Open Iceber opened this issue 4 years ago • 9 comments

"bind" is confusing as a fstype argument.

    unix.Mount(node.Path, dest, "bind", unix.MS_BIND, "")

And the fstype argument is ignored for bind mount.

 func Mount(source string, target string, fstype string, flags uintptr, data string) (err error) 

Iceber avatar Feb 01 '21 06:02 Iceber

need to merge https://github.com/opencontainers/runc/pull/2775

Iceber avatar Feb 01 '21 06:02 Iceber

It is already "" in some places -- and I agree we should convert the test.

Nit: typo in commit subject: s/amount/mount/

kolyshkin avatar Feb 01 '21 17:02 kolyshkin

@Iceber can you please rebase to fix CI?

kolyshkin avatar Feb 01 '21 17:02 kolyshkin

@kolyshkin use grep unix.Mount . -r | grep bind to find and modify other files

Iceber avatar Feb 02 '21 02:02 Iceber

This one gives me pause. I think we had some edge cases in the past where this was needed maybe for mount propagation or remounts.

mrunalp avatar Feb 02 '21 22:02 mrunalp

I don't think so @mrunalp -- fstype has always been ignored for all of the key flags (MS_BIND, MS_MOVE, MS_REMOUNT ...). The issue we had in the past was that internally libcontainer requires you to specify bind or rbind as types (in other words, the bind option didn't actually do anything if you didn't also specify the type). (Though this has since been mostly(?) fixed now.)

I'm fine with dropping it, though I don't personally think it's confusing to have it -- it makes strace(1) output slightly nicer to read.

cyphar avatar Feb 04 '21 02:02 cyphar

Better to move to v1.1.0 milestone?

AkihiroSuda avatar Feb 04 '21 03:02 AkihiroSuda

I think it's trivial enough it doesn't need to be blocked on 1.0, but I don't really mind (it's a no-op change anyway).

cyphar avatar Feb 04 '21 04:02 cyphar

Agree we can do it post 1.0

kolyshkin avatar Feb 04 '21 19:02 kolyshkin