Ping? Might have ended in the spam bucket again...

On Wed, Jun 22, 2022, 00:30 Yi-yo Chiang <yochi...@google.com> wrote:

> `mount -o private mountpoint` should change the mount propagation type
> of mountpoint to MS_PRIVATE. This didn't work because it falls into
> the "read /etc/fstab" branch (one argument), and fails when mountpoint
> is not found in the fstab, or fstab is not found (Android case).
>
> `mount -o private blah mountpoint` kind of works, as long as `blah`
> doesn't look like a directory, otherwise toybox would assume bind mount
> and MS_BIND would win over MS_PRIVATE.
>
> Even if `blah mountpoint` looks sufficient unlike a bind mount, the
> underlying mount() syscall would be a bit off,
>   mount(blah, mountpoint, "ext3", MS_SILENT|MS_PRIVATE, "")
>
> The "ext3" (or whatever comes first in /proc/filesystems) is because
> unspecified `-t` defaults to `-t auto`, which means "try mount FS in
> /proc/filesystems one-by-one", which is not what we want here. We don't
> want to mount anything, but change an existing mountpoint's propagation
> type.
>
> This patch adds "mount -o private mountpoint" machinery and unit test.
>
> --
>
> Yi-yo Chiang
> Software Engineer
> yochi...@google.com
>
> I support flexible work schedules, and I’m sending this email now because
> it is within the hours I’m working today. Please do not feel obliged to
> reply straight away - I understand that you will reply during the hours you
> work, which may not match mine.
>
_______________________________________________
Toybox mailing list
Toybox@lists.landley.net
http://lists.landley.net/listinfo.cgi/toybox-landley.net

Reply via email to