Skip to content

Conversation

kernel-patches-daemon-bpf[bot]
Copy link

Pull request for series with
subject: bpftool: Mount bpffs on provided dir instead of parent dir
version: 3
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=837147

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 4c2a26f
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=837147
version: 3

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: af8d27b
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=837147
version: 3

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: af8d27b
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=837147
version: 3

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 61df575
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=837147
version: 3

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 476a5e9
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=837147
version: 3

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: a849750
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=837147
version: 3

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 770546a
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=837147
version: 3

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 14bb1e8
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=837147
version: 3

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: e0754c1
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=837147
version: 3

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 14bb1e8
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=837147
version: 3

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 2a702c2
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=837147
version: 3

When pinning programs/objects under PATH (eg: during "bpftool prog
loadall") the bpffs is mounted on the parent dir of PATH in the
following situations:
- the given dir exists but it is not bpffs.
- the given dir doesn't exist and the parent dir is not bpffs.

Mounting on the parent dir can also have the unintentional side-
effect of hiding other files located under the parent dir.

If the given dir exists but is not bpffs, then the bpffs should
be mounted on the given dir and not its parent dir.

Similarly, if the given dir doesn't exist and its parent dir is not
bpffs, then the given dir should be created and the bpffs should be
mounted on this new dir.

Link: https://lore.kernel.org/bpf/2da44d24-74ae-a564-1764-afccf395eeec@isovalent.com/T/#t
Closes: libbpf/bpftool#100
Fixes: 2a36c26 ("bpftool: Support bpffs mountpoint as pin path for prog loadall")

Changes since v1:
 - Split "mount_bpffs_for_pin" into two functions.
   This is done to improve maintainability and readability.

Changes since v2:
- mount_bpffs_for_pin: rename to "create_and_mount_bpffs_dir".
- mount_bpffs_given_file: rename to "mount_bpffs_given_file".
- create_and_mount_bpffs_dir:
  - introduce "dir_exists" boolean.
  - remove new dir if "mnt_fs" fails.
- improve error handling and error messages.

Signed-off-by: Sahil Siddiq <icegambit91@gmail.com>
@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 2a720cc
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=837147
version: 3

@kernel-patches-daemon-bpf
Copy link
Author

At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=837147 expired. Closing PR.

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.

1 participant