401 Star 1.4K Fork 1.3K

GVPopenEuler / kernel

 / 详情

【23.09-RC2】【x86/arm】在字符设备文件上挂载文件系统失败

已验收
缺陷
创建于  
2023-09-05 17:18

【环境信息】
OS版本:23.09-RC2
内核: kernel-6.4.0-3.0.0.11.oe2309
repo:os、everything、epol
http://121.36.84.172/dailybuild/EBS-openEuler-23.09/rc2_openeuler-2023-08-30-23-34-40/
【问题复现步骤】
前置条件:

  1. 创建pv
    pvcreate /dev/vdb
  2. 创建vg
    vgcreate vggroup /dev/vdb
  3. 创建lv
    lvcreate -n lv1 -L 1G vggroup -y
    lvcreate -n lv2 -L 1G vggroup -y
    lvcreate -n lv3 -L 1G vggroup -y
  4. 创建fs
    mkfs.ext3 /dev/vggroup/lv1
    mkfs.ext4 /dev/vggroup/lv2
    mkfs.xfs /dev/vggroup/lv3
  5. 创建字符设备文件
    mknod /mnt/testc c /mnt/testc 1 1
    执行步骤:
  6. 在空目录上挂载Ext3:
    mount /dev/vggroup/lv1 /mnt/testc
  7. 在空目录上挂载Ext4:
    mount /dev/vggroup/lv2 /mnt/testc
  8. 在空目录上挂载xfs:
    mount /dev/vggroup/lv3 /mnt/testc
    【预期结果】
    1、文件系统ext3挂载成功
    2、文件系统ext4挂载成功
    3、文件系统xfs挂载成功
    【实际结果】
    1、文件系统ext3挂载失败
    2、文件系统ext4挂载失败
    3、文件系统xfs挂载失败
    【附件信息】
    输入图片说明

评论 (10)

zjl_long 创建了缺陷

Hi zjl_long, welcome to the openEuler Community.
I'm the Bot here serving you. You can find the instructions on how to interact with me at Here.
If you have any questions, please contact the SIG: Kernel, and any of the maintainers.

openeuler-ci-bot 添加了
 
sig/Kernel
标签
zjl_long 负责人设置为Wei Li
zjl_long 计划截止日期设置为2023-09-06
zjl_long 计划开始日期设置为2023-09-05
zjl_long 计划截止日期2023-09-06 修改为2023-09-08
zjl_long 优先级设置为主要
zjl_long 里程碑设置为openEuler-23.09-round-2

这个用例在20.03、22.03上可以成功吗?

Wei Li 添加协作者Wei Li
Wei Li 负责人Wei Li 修改为Zhang Yi

5.创建字符设备文件
mknod /mnt/testc c /mnt/testc 1 1

[root@localhost ~]# mknod /mnt/testc c /mnt/testc 1 1
mknod: extra operand ‘1’
Try 'mknod --help' for more information.
SYNOPSIS
       mknod [OPTION]... NAME TYPE [MAJOR MINOR]

根据man手册查询到的信息,如上指令是不能创建字符设备的,请问下你是怎样执行的,是否有完整的日志可以提供?

6.在空目录上挂载Ext3:
mount /dev/vggroup/lv1 /mnt/testc

[root@localhost ~]# mknod /mnt/testc c 1 1
[root@localhost ~]# mount /dev/vggroup/lv1 /mnt/testc
mount: /mnt/testc: mount point is not a directory.
[root@localhost ~]#

/mnt/testc 作为一个字符设备,要将块设备挂载在字符设备上,这个操作我也不太理解,如果有完整日志也麻烦提供一下

这个用例在之前版本如果成功执行过,麻烦也提供一下日志,谢谢

分析:
1、对比成功和失败日志,可以看到用例失败不是因为挂载失败,块设备往字符设备上挂载预期就是失败的,失败原因是从mount命令的返回结果中grep不到“mount point is not a directory”,和预期不符
2、在23.09上测试,块设备上文件系统正常的情况下,将块设备挂载到字符设备,会报“mount point is not a directory”;如果损坏了文件系统,挂载命令会报截图中的文件系统损坏,而不是“mount point is not a directory”,从而与用例的预期结果不符

初步结论:
挂载前文件系统有问题,导致mount返回的结果与预期不符,从而导致用例失败

建议:
先复现出问题,再用fsck检测文件系统是否正常

zjl_long 添加协作者zhaotianyang

@zhaotianyang 由于23.09版本util-linux升级,导致文件系统挂载的时候,mount命令报错:wrong fs type;事实上,文件系统是正常的
输入图片说明
对util-linux降级,执行mount命令,符合预期:mount point is not a directory
输入图片说明

zjl_long 取消协作者zhaotianyang
zjl_long 负责人Zhang Yi 修改为zhaotianyang
zjl_long 添加协作者zhangyao2022

2.39.1版本mount使用一组fsconfig api进行挂载操作,当前问题发生在其中调用SYS_move_mount时,系统返回错误码EINVAL,打印wrong fs type, bad option, bad superblock on %s missing codepage or helper program, or other error",在2.37.2版本上,只使用mount api进行挂载,系统返回错误码ENOTDIR,打印"mount point is not a directory"。

你的意思我明白,因为util-linux高低版本执行mount命令返回的错误码不一样,所以错误信息就不同。
可是高版本的这个错误信息不够准确,实际上文件系统是正确的,建议优化错误提示信息

通过指定的返回值,提示信息并没有指定是文件系统的问题,和社区保持一致,目前不更改。

zhaotianyang 任务状态待办的 修改为已完成

同意以上观点,提示信息暂不做优化,issue关闭

zjl_long 任务状态已完成 修改为已验收

登录 后才可以发表评论

状态
负责人
项目
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
预计工期 (小时)
参与者(5)
5329419 openeuler ci bot 1632792936 5625574 stkid 1587900794
C
1
https://gitee.com/openeuler/kernel.git
git@gitee.com:openeuler/kernel.git
openeuler
kernel
kernel

搜索帮助