Skip to content

mountinfo: parse empty strings in source#652

Merged
liangchenye merged 1 commit intoopencontainers:masterfrom
kinvolk-archives:alban/mount-empty-source
Jul 20, 2018
Merged

mountinfo: parse empty strings in source#652
liangchenye merged 1 commit intoopencontainers:masterfrom
kinvolk-archives:alban/mount-empty-source

Conversation

@alban
Copy link
Copy Markdown
Contributor

@alban alban commented Jun 22, 2018

The source of a mount in /proc/self/mountinfo can unfortunately be an
empty string. Before this patch, 'mount' and 'mountpoint' fail as
following:

  $ sudo mount -t tmpfs "" /tmp/bb
  $ mount
  mount: /proc/self/mountinfo: parse error at line 64 -- ignored
  $ mountpoint /tmp/bb
  /tmp/bb is not a mountpoint

This patch fixes the parsing.

Signed-off-by: Alban Crequy alban@kinvolk.io


Similar patch in util-linux: https://www.spinics.net/lists/linux-fsdevel/msg128896.html
Similar PR in runc: opencontainers/runc#1829
Related patch that would fix this kernel-side: https://patchwork.kernel.org/patch/10349095/

The source of a mount in /proc/self/mountinfo can unfortunately be an
empty string. Before this patch, 'mount' and 'mountpoint' fail as
following:

  $ sudo mount -t tmpfs "" /tmp/bb
  $ mount
  mount: /proc/self/mountinfo: parse error at line 64 -- ignored
  $ mountpoint /tmp/bb
  /tmp/bb is not a mountpoint

This patch fixes the parsing.

Signed-off-by: Alban Crequy <alban@kinvolk.io>
@liangchenye
Copy link
Copy Markdown
Member

liangchenye commented Jul 20, 2018

LGTM
It works in my test.

Approved with PullApprove

@liangchenye liangchenye merged commit d2fbafa into opencontainers:master Jul 20, 2018
@dongsupark dongsupark deleted the alban/mount-empty-source branch August 22, 2018 07:09
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.

2 participants