Some filesystems (like cd9660 and ext3) require that VFS_STATFS()
be called before VFS_ROOT() is called. Move the call for VFS_STATFS() so that it is done after VFS_MOUNT(), but before VFS_ROOT(). This change actually improves the robustness of the mount system call because it returns an error rather than failing silently when VFS_STATFS() returns failure. Reported by: Rebecca Cran <rebecca@bluestop.org> Sponsored by: Netflix
This commit is contained in:
parent
d6b88d6067
commit
b9ea8013d1
@ -895,6 +895,7 @@ vfs_domount_first(
|
||||
*/
|
||||
error1 = 0;
|
||||
if ((error = VFS_MOUNT(mp)) != 0 ||
|
||||
(error1 = VFS_STATFS(mp, &mp->mnt_stat)) != 0 ||
|
||||
(error1 = VFS_ROOT(mp, LK_EXCLUSIVE, &newdp)) != 0) {
|
||||
if (error1 != 0) {
|
||||
error = error1;
|
||||
@ -916,7 +917,6 @@ vfs_domount_first(
|
||||
vfs_freeopts(mp->mnt_opt);
|
||||
mp->mnt_opt = mp->mnt_optnew;
|
||||
*optlist = NULL;
|
||||
(void)VFS_STATFS(mp, &mp->mnt_stat);
|
||||
|
||||
/*
|
||||
* Prevent external consumers of mount options from reading mnt_optnew.
|
||||
|
Loading…
x
Reference in New Issue
Block a user