Bug 216813

Summary: mount_msdosfs: regression in handling the -L flag
Product: Base System Reporter: Mikhail Teterin <mi>
Component: binAssignee: freebsd-bugs (Nobody) <bugs>
Status: New ---    
Severity: Affects Only Me CC: emaste
Priority: --- Keywords: patch, regression
Version: 10.3-RELEASE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
Work-around none

Description Mikhail Teterin freebsd_committer freebsd_triage 2017-02-05 08:22:13 UTC
Created attachment 179628 [details]
Work-around

Trying to mount an MS-DOS formatted USB-stick with

% mount_msdosfs -D utf8 -L uk_UA.KOI8-U /dev/da4 /mnt

fails with:

mount_msdosfs: msdosfs_iconv: File exists

(As it used to in 2008, see Bug 129720). After the command exits, the  msdosfs_iconv.ko is listed by kldstat. So, something loads it, then tries to load it again and fails.

The attached patch provides a work-around for mount_msdosfs(8) -- this allowed me to mount the device in a hurry. However, I suspect, it is the kiconv_add_xlat16_cspairs(3), that needs fixing instead.
Comment 1 Conrad Meyer freebsd_committer freebsd_triage 2017-02-15 05:01:03 UTC
Seems to work fine on CURRENT:
$ dd if=/dev/zero of=./testfs.img bs=1m count=50
$ sudo mdconfig -a -t vnode -f testfs.img
$ sudo newfs_msdos /dev/md0
$ mkdir mnt
$ sudo truss -o truss.log mount_msdosfs -D utf8 -L uk_UA.KOI8-U /dev/md0 ./mnt
$ echo $?
0
Comment 2 Mikhail Teterin freebsd_committer freebsd_triage 2017-02-15 06:00:04 UTC
From somebody else's report (http://forum.lissyara.su/viewtopic.php?t=44099), it would seem, the problem is triggered by the:

options MSDOSFS_ICONV

in kernel-config. I do not have that here, but I do have `options LIBICONV'

My problems were on 10.3, though, not CURRENT.