From 7d6769cb4a245d78df5bad976d55ffed09e443ca Mon Sep 17 00:00:00 2001 From: asomers Date: Fri, 21 Oct 2016 17:39:05 +0000 Subject: [PATCH] MFC r306276, but don't remove findwin95 Mount msdosfs with longnames support by default. The old behavior depended on the FAT version and on what files were in the root directory. "mount_msdosfs -o shortnames" is still supported. git-svn-id: svn://svn.freebsd.org/base/stable/10@307742 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- sbin/mount_msdosfs/mount_msdosfs.8 | 9 +-------- sys/fs/msdosfs/msdosfs_vfsops.c | 20 ++------------------ 2 files changed, 3 insertions(+), 26 deletions(-) diff --git a/sbin/mount_msdosfs/mount_msdosfs.8 b/sbin/mount_msdosfs/mount_msdosfs.8 index 3e4b08d46..9f39ffb80 100644 --- a/sbin/mount_msdosfs/mount_msdosfs.8 +++ b/sbin/mount_msdosfs/mount_msdosfs.8 @@ -142,15 +142,8 @@ If neither nor .Fl l are given, -.Nm -searches the root directory of the file system to -be mounted for any existing Win'95 long filenames. -If no such entries are found, but short DOS filenames are found, -.Fl s -is the default. -Otherwise .Fl l -is assumed. +is the default. .It Fl 9 Ignore the special Win'95 directory entries even if deleting or renaming a file. diff --git a/sys/fs/msdosfs/msdosfs_vfsops.c b/sys/fs/msdosfs/msdosfs_vfsops.c index 7c6d3ed08..b3875e759 100644 --- a/sys/fs/msdosfs/msdosfs_vfsops.c +++ b/sys/fs/msdosfs/msdosfs_vfsops.c @@ -175,24 +175,8 @@ update_mp(struct mount *mp, struct thread *td) if (pmp->pm_flags & MSDOSFSMNT_NOWIN95) pmp->pm_flags |= MSDOSFSMNT_SHORTNAME; - else if (!(pmp->pm_flags & - (MSDOSFSMNT_SHORTNAME | MSDOSFSMNT_LONGNAME))) { - struct vnode *rootvp; - - /* - * Try to divine whether to support Win'95 long filenames - */ - if (FAT32(pmp)) - pmp->pm_flags |= MSDOSFSMNT_LONGNAME; - else { - if ((error = - msdosfs_root(mp, LK_EXCLUSIVE, &rootvp)) != 0) - return error; - pmp->pm_flags |= findwin95(VTODE(rootvp)) ? - MSDOSFSMNT_LONGNAME : MSDOSFSMNT_SHORTNAME; - vput(rootvp); - } - } + else + pmp->pm_flags |= MSDOSFSMNT_LONGNAME; return 0; } -- 2.45.0