Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 12 Nov 2006 03:54:52 +0700 (KRAT)
From:      Eugene Grosbein <eugen@grosbein.pp.ru>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   kern/105412: [msdosfs] msdosfs mounted as r/o cannot be remounted to r/w
Message-ID:  <200611112054.kABKsqnM002902@grosbein.pp.ru>
Resent-Message-ID: <200611112100.kABL0g8f057318@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         105412
>Category:       kern
>Synopsis:       [msdosfs] msdosfs mounted as r/o cannot be remounted to r/w
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Nov 11 21:00:41 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Eugene Grosbein
>Release:        FreeBSD 6.2-PRERELEASE i386
>Organization:
Svyaz Service JSC
>Environment:
System: FreeBSD grosbein.pp.ru 6.2-PRERELEASE FreeBSD 6.2-PRERELEASE #20: Fri Nov 10 20:05:19 KRAT 2006 eu@grosbein.pp.ru:/mnt/home/obj/usr/local/src/sys/DADV i386

>Description:

	It must be possible to remount msdosfs from r/o to r/w

>How-To-Repeat:

	Let's make an image for file system to play with:

# dd if=/dev/zero bs=1k count=1440 of=image

	Then make it device /dev/md0:

# mdconfig -a -t vnode -f image

	Then make new filesystem to mount:

# newfs_msdos -f 1440 /dev/md0

	Then mount it read-only:

# mount_msdosfs -o ro /dev/md0 /mnt/tmp

	Now look at this:

# mount | grep md0
/dev/md0 on /mnt/tmp (msdosfs, local, read-only)

	Still good. Now try to remount it r/w:

# mount -u -o rw /dev/md0; echo $?
0

	It pretends to finish with success. But it has failed:

# echo test > /mnt/tmp/test; mount | grep md0
bash: /mnt/tmp/test: Read-only file system
/dev/md0 on /mnt/tmp (msdosfs, local, read-only)

>Fix:

	Unknown. There are two problems really.
	First, mount(8) does not treat msdosfs as remountable.
	This should be fixed with the following patch:

--- sbin/mount/mount.c.orig	Sun Nov 12 01:16:13 2006
+++ sbin/mount/mount.c	Sun Nov 12 01:16:23 2006
@@ -116,7 +116,7 @@
  */
 static const char *
 remountable_fs_names[] = {
-	"ufs", "ffs", "ext2fs",
+	"ufs", "ffs", "ext2fs","msdosfs",
 	0
 };
 

	Second, "mount -o update,noro /dev/md0" results in
	a call to msdosfs_mount() that for some reason finds "export"
	option in its arguments and just returns 0 effectively ignoring
	the request for upgrade to r/w.

Eugene Grosbein
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200611112054.kABKsqnM002902>