Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

While having boot.mount active, CBM should "lock" it. #184

Open
ahkok opened this issue Oct 22, 2019 · 1 comment
Open

While having boot.mount active, CBM should "lock" it. #184

ahkok opened this issue Oct 22, 2019 · 1 comment
Assignees

Comments

@ahkok
Copy link
Contributor

ahkok commented Oct 22, 2019

Now that fwupd and other tools potentially also mount and unmount /boot, we need to assure that, while manipulations are made, the filesystem isn't unmounted by someone else.

The easiest and cleanest solution @fenrus75 and me came up with at lunch is to use opendir() and keep the DIR entry open as long as operations are proceeding.

The reason we don't want to lock a file is because we don't want to create lockfiles for no reason.

opendir() will prevent unmounting. We can lazy unmount as well to further make things more reliable.

	DIR *d = opendir("/boot/loader");
	//do work
	closedir(d);
@ahkok
Copy link
Contributor Author

ahkok commented Oct 22, 2019

Note: the reason we use opendir is because fusermount and lsof will indicate it's holding a file descriptor open.

@dorileo dorileo self-assigned this Jan 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants