[Bugme-new] [Bug 12368] New: mount() returns ENODEV when the requested filesystem is not supported, which is confusing.

bugme-daemon at bugzilla.kernel.org bugme-daemon at bugzilla.kernel.org
Mon Jan 5 15:32:14 PST 2009


http://bugzilla.kernel.org/show_bug.cgi?id=12368

           Summary: mount() returns ENODEV when the requested filesystem is
                    not supported, which is confusing.
           Product: File System
           Version: 2.5
     KernelVersion: 2.6.28
          Platform: All
        OS/Version: Linux
              Tree: Mainline
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: Other
        AssignedTo: fs_other at kernel-bugs.osdl.org
        ReportedBy: jimsantelmo at gmail.com


The syscall mount() returns  ENODEV if there is no driver available for the
filesystem (see below). This is a very confusing error message to get in this
situation, since it is logical to conclude that there is a problem with the
requested device rather than the filesystem type. Returning ENOPKG, EUNATCH or
ENOTSUP would give more of a clue to the actual problem.

  V7 and 4.3BSD only had one filesystem; there is no code in them for this
case, I think. Opensolaris appears to return EINVAL (see
http://tamacom.com/tour/kernel/solaris/S/3736.html#L792
). FreeBSD appears to return ENODEV (see
http://tamacom.com/tour/kernel/freebsd/S/4513.html#L804
).

 Probably changing this behavior is politically impossible, but I wanted to
mention the idea anyway.

fs/super.c::do_kernel_mount():
struct vfsmount *
do_kern_mount(const char *fstype, int flags, const char *name, void *data)
{
        struct file_system_type *type = get_fs_type(fstype);
        struct vfsmount *mnt;
        if (!type)
                return ERR_PTR(-ENODEV);
        mnt = vfs_kern_mount(type, flags, name, data);
        if (!IS_ERR(mnt) && (type->fs_flags & FS_HAS_SUBTYPE) &&
            !mnt->mnt_sb->s_subtype)
                mnt = fs_set_subtype(mnt, fstype);
        put_filesystem(type);
        return mnt;
}


-- 
Configure bugmail: http://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


More information about the Bugme-new mailing list