函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Create a kernel mount representation for a new, prepared superblock* (specified by fs_fd) and attach to an open_tree-like file descriptor.

函数原型:SYSCALL_DEFINE3(fsmount, int, fs_fd, unsigned int, flags, unsigned int, attr_flags)

返回类型:

参数:

3375  mnt_flags等于0
3378  如果非Is the caller allowed to modify his namespace?则返回:负EPERM
3381  如果flags按位与smount() flags.的反的值不等于0则返回:负EINVAL
3384  如果attr_flags按位与Mount read-only 按位或Ignore suid and sgid bits 按位或Disallow access to device special files 按位或Disallow program execution 按位或Setting on how atime should be updated 按位或Do not update directory access times 的值的反则返回:负EINVAL
3392  如果attr_flags按位与Mount read-only mnt_flags或等于does the user want this to be r/o?
3394  如果attr_flags按位与Ignore suid and sgid bits mnt_flags或等于MNT_NOSUID
3396  如果attr_flags按位与Disallow access to device special files mnt_flags或等于MNT_NODEV
3398  如果attr_flags按位与Disallow program execution mnt_flags或等于MNT_NOEXEC
3400  如果attr_flags按位与Do not update directory access times mnt_flags或等于MNT_NODIRATIME
3404  : & == - Always perform atime updates
3405  退出
3406  : & == - Do not update access times.
3407  mnt_flags或等于MNT_NOATIME
3408  退出
3409  : & == - Update atime relative to mtime/ctime.
3410  mnt_flags或等于MNT_RELATIME
3411  退出
3412  默认
3413  返回:负EINVAL
3416  f等于fdget(fs_fd)
3417  如果非file则返回:负EBADF
3420  ret等于负EINVAL
3421  如果f_op不等于fscontext_fops则转到:err_fsfd
3424  fc等于 needed for tty driver, and maybe others
3426  ret等于mutex_lock_interruptible( & uapi_mutex)
3427  如果ret小于0则转到:err_fsfd
3431  ret等于负EINVAL
3432  如果非root则转到:err_unlock
3435  ret等于负EPERM
3436  如果mount_too_revealing(d_sb, & mnt_flags)则
3437  打印警告信息("VFS: Mount too revealing\n")
3438  转到:err_unlock
3441  ret等于负EBUSY
3442  如果phase不等于FS_CONTEXT_AWAITING_MOUNT则转到:err_unlock
3445  ret等于负EPERM
3446  如果sb_flags按位与Allow mandatory locks on an FS 且非may_mandlock()则转到:err_unlock
3449  mnt等于vfs_create_mount - Create a mount for a configured superblock*@fc: The configuration context with the superblock attached* Create a mount to an already configured superblock. If necessary, the* caller should invoke vfs_get_tree() before calling this.
3450  如果是错误
3451  ret等于错误
3452  转到:err_unlock
3454  dentry等于获得目录项引用
3455  mnt_flags等于mnt_flags
3462  vfs_clean_context(fc)
3464  ns等于alloc_mnt_ns(user_ns, true)
3465  如果是错误
3466  ret等于错误
3467  转到:err_path
3469  mnt等于real_mount(mnt)
3470  containing namespace 等于ns
3471  root等于mnt
3472  # of mounts in the namespace 等于1
3473  添加链表项
3474  mntget(mnt)
3479  file等于dentry_open( & newmount, O_PATH, cred)
3480  如果是错误
3481  dissolve_on_fput(mnt)
3482  ret等于错误
3483  转到:err_path
3485  f_mode或等于File represents mount that needs unmounting
3487  ret等于get_unused_fd_flags((flags & smount() flags.) ? O_CLOEXEC : 0)
3488  如果ret大于等于0则fd_install(ret, file)
3490  否则fput(file)
3493  err_path :
3494  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.
3495  err_unlock :
3496  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
3497  err_fsfd :
3498  fdput(f)
3499  返回:ret