Created
September 3, 2018 06:18
-
-
Save naota/5b144de1e2396aab8e717a63c39561f8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int livepatch_user_statfs(const char __user *pathname, struct kstatfs *st) | |
{ | |
struct path path; | |
int error; | |
unsigned int lookup_flags = LOOKUP_FOLLOW|LOOKUP_AUTOMOUNT; | |
retry: | |
error = user_path_at(AT_FDCWD, pathname, lookup_flags, &path); | |
if (!error) { | |
error = vfs_statfs(&path, st); | |
if (!error) | |
st->f_type = EXT4_SUPER_MAGIC; | |
path_put(&path); | |
if (retry_estale(error, lookup_flags)) { | |
lookup_flags |= LOOKUP_REVAL; | |
goto retry; | |
} | |
} | |
return error; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment