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

Remove needless access() in efivarfs_probe() #261

Merged
merged 1 commit into from
Jan 29, 2024

Conversation

nabijaczleweli
Copy link
Contributor

The access() is always validated(!?) by a statfs(): there's no need for this, but this incurs an additional syscall

git show -w:

diff --git a/src/efivarfs.c b/src/efivarfs.c
index d4cee45..fe7ba9e 100644
--- a/src/efivarfs.c
+++ b/src/efivarfs.c
@@ -69,7 +69,6 @@ efivarfs_probe(void)
 {
        const char *path = get_efivarfs_path();

-       if (!access(path, F_OK)) {
        int rc = 0;
        struct statfs buf;

@@ -91,9 +90,6 @@ efivarfs_probe(void)
        } else {
                efi_error("statfs(%s) failed", path);
        }
-       } else {
-               efi_error("access(%s, F_OK) failed", path);
-       }

        return 0;
 }

The access() is always seemingly-validated by a statfs():
there's no need for this, but this incurs an additional syscall

Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
@vathpela vathpela merged commit af8bc6d into rhboot:main Jan 29, 2024
6 of 7 checks passed
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.

None yet

2 participants