函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\namespace.c Create Date:2022-07-29 10:39:48
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:pivot_root Semantics:* Moves the root file system of the current process to the directory put_old,* makes new_root as the new root file system of the current process, and sets* root/cwd of all processes which had them on the current root to new_root

函数原型:SYSCALL_DEFINE2(pivot_root, const char __user *, new_root, const char __user *, put_old)

返回类型:

参数:

3618  如果非Is the caller allowed to modify his namespace?则返回:负EPERM
3621  error等于user_path_at(Special value used to indicateopenat should use the currentworking directory. , new_root, llow links at the end | quire a directory , & new)
3623  如果error则转到:out0
3626  error等于user_path_at(Special value used to indicateopenat should use the currentworking directory. , put_old, llow links at the end | quire a directory , & old)
3628  如果error则转到:out1
3631  error等于security_sb_pivotroot( & old, & new)
3632  如果error则转到:out2
3635  get_fs_root(fs, & root)
3636  old_mp等于lock_mount( & old)
3637  error等于错误
3638  如果是错误则转到:out3
3641  error等于负EINVAL
3642  new_mnt等于real_mount(mnt)
3643  root_mnt等于real_mount(mnt)
3644  old_mnt等于real_mount(mnt)
3645  ex_parent等于mnt_parent
3646  root_parent等于mnt_parent
3647  如果IS_MNT_SHARED(old_mnt)或IS_MNT_SHARED(ex_parent)或IS_MNT_SHARED(root_parent)则转到:out4
3651  如果非check_mnt(root_mnt)或非check_mnt(new_mnt)则转到:out4
3653  如果mnt_flags按位与MNT_LOCKED则转到:out4
3655  error等于负ENOENT
3656  如果d_unlinked(dentry)则转到:out4
3658  error等于负EBUSY
3659  如果new_mnt恒等于root_mntold_mnt恒等于root_mnt则转到:out4
3661  error等于负EINVAL
3662  如果mnt_root不等于dentry则转到:out4
3664  如果非mnt_has_parent(root_mnt)则转到:out4
3666  如果mnt_root不等于dentry则转到:out4
3668  如果非mnt_has_parent(new_mnt)则转到:out4
3671  如果非Return true if path is reachable from root* namespace_sem or mount_lock is held则转到:out4
3674  如果非Return true if path is reachable from root* namespace_sem or mount_lock is held则转到:out4
3676  lock_mount_hash()
3677  vfsmount lock must be held for write
3678  root_mp等于vfsmount lock must be held for write
3679  如果mnt_flags按位与MNT_LOCKED
3680  mnt_flags或等于MNT_LOCKED
3681  mnt_flags与等于MNT_LOCKED的反
3684  vfsmount lock must be held for write
3686  vfsmount lock must be held for write
3687  vfsmount lock must be held for read
3688  vfsmount lock must be held for write
3690  删除链表项并重新初始化
3691  alled with namespace_lock and vfsmount lock
3692  unlock_mount_hash()
3693  chroot_fs_refs( & root, & new)
3694  error等于0
3695  out4 :
3696  unlock_mount(old_mp)
3697  如果非errormntput_no_expire(ex_parent)
3699  out3 :
3700  path_put - put a reference to a path*@path: path to put the reference to* Given a path decrement the reference count to the dentry and the vfsmount.
3701  out2 :
3702  path_put - put a reference to a path*@path: path to put the reference to* Given a path decrement the reference count to the dentry and the vfsmount.
3703  out1 :
3704  path_put - put a reference to a path*@path: path to put the reference to* Given a path decrement the reference count to the dentry and the vfsmount.
3705  out0 :
3706  返回:error