Skip to contentSkip to conversation

FAT: kill nls default

PATCH New OGAWA Hirofumi 1 participant 1 message Jul 16, 2004

Subsystems (3)
lore
Share & tools
lore

OGAWA Hirofumi

author maintainer
#0 lore raw

PATCH 1/1 FAT: kill nls default

Previously, fatfs was using NLS_DEFAULT if users didn't specify the codepage or iocharset option. This became cause of trouble (filename access).

This patch removes the complicated default config in kernel.

Instead of it, by default, fatfs uses builtin nls ("default"), also reports it and mounts as read-only. This default will limit the access more or less. Note: If peoples want to write on this default, it still can switch by remount.

Therefore, basically users will need to specify mount options always. ("codepage" for msdos, and "codepage" and "iocharset" for vfat) However, it can be done simply by script or shell alias or something else in userland.

Thanks to Andries Brouwer for your many advice.

---

 Documentation/filesystems/vfat.txt |   11 ++-
 fs/Kconfig                         |   57 -----------------
 fs/fat/inode.c                     |  120 ++++++++++++++++++++++---------------
 3 files changed, 82 insertions(+), 106 deletions(-)
fs/Kconfig renamed from fs/Kconfig~fat_default-nls +0 -57
diff -puN fs/Kconfig~fat_default-nls fs/Kconfig
@@ -554,44 +554,6 @@ menu "DOS/FAT/NT Filesystems"
 config FAT_FS
 	tristate
 	select NLS
-	help
-	  If you want to use one of the FAT-based file systems (the MS-DOS,
-	  VFAT (Windows 95) and UMSDOS (used to run Linux on top of an
-	  ordinary DOS partition) file systems), then you must say Y or M here
-	  to include FAT support. You will then be able to mount partitions or
-	  diskettes with FAT-based file systems and transparently access the
-	  files on them, i.e. MSDOS files will look and behave just like all
-	  other Unix files.
-
-	  This FAT support is not a file system in itself, it only provides
-	  the foundation for the other file systems. You will have to say Y or
-	  M to at least one of "MSDOS fs support" or "VFAT fs support" in
-	  order to make use of it.
-
-	  Another way to read and write MSDOS floppies and hard drive
-	  partitions from within Linux (but not transparently) is with the
-	  mtools ("man mtools") program suite. You don't need to say Y here in
-	  order to do that.
-
-	  If you need to move large files on floppies between a DOS and a
-	  Linux box, say Y here, mount the floppy under Linux with an MSDOS
-	  file system and use GNU tar's M option. GNU tar is a program
-	  available for Unix and DOS ("man tar" or "info tar").
-
-	  It is now also becoming possible to read and write compressed FAT
-	  file systems; read <file:Documentation/filesystems/fat_cvf.txt> for
-	  details.
-
-	  The FAT support will enlarge your kernel by about 37 KB. If unsure,
-	  say Y.
-
-	  To compile this as a module, choose M here: the module will be called
-	  fat.  Note that if you compile the FAT support as a module, you
-	  cannot compile any of the FAT-based file systems into the kernel
-	  -- they will have to be modules as well.
-	  The file system of your root partition (the one containing the
-	  directory /) cannot be a module, so don't say M here if you intend
-	  to use UMSDOS as your root file system.
 
 config MSDOS_FS
 	tristate "MSDOS fs support"
@@ -644,25 +606,6 @@ config VFAT_FS
 	  To compile this as a module, choose M here: the module will be called
 	  vfat.
 
-config FAT_DEFAULT_CODEPAGE
-	int "Default codepage for FAT"
-	depends on MSDOS_FS || VFAT_FS
-	default 437
-	help
-	  This option should be set to the codepage of your FAT filesystems.
-	  It can be overridden with the 'codepage' mount option.
-
-config FAT_DEFAULT_IOCHARSET
-	string "Default iocharset for FAT"
-	depends on VFAT_FS
-	default "iso8859-1"
-	help
-	  Set this to the default I/O character set you'd like FAT to use.
-	  It should probably match the character set that most of your
-	  FAT filesystems use, and can be overridded with the 'iocharset'
-	  mount option for FAT filesystems.  Note that UTF8 is *not* a
-	  supported charset for FAT filesystems.
-
 config UMSDOS_FS
 #dep_tristate '    UMSDOS: Unix-like file system on top of standard MSDOS fs' CONFIG_UMSDOS_FS $CONFIG_MSDOS_FS
 # UMSDOS is temprory broken
fs/fat/inode.c renamed from fs/fat/inode.c~fat_default-nls +74 -46

199 lines not on this page · raw message

Documentation/filesystems/vfat.txt renamed from Documentation/filesystems/vfat.txt~fat_default-nls +8 -3
diff -puN Documentation/filesystems/vfat.txt~fat_default-nls Documentation/filesystems/vfat.txt
@@ -19,18 +19,23 @@ fmask=###     -- The permission mask for
 
 codepage=###  -- Sets the codepage number for converting to shortname
 		 characters on FAT filesystem.
-		 By default, FAT_DEFAULT_CODEPAGE setting is used.
+
+		 NOTE: If this option was not specified, the file name
+		 may not be read/written rightly, also filesystem is
+		 mounted as read-only.
 
 iocharset=name -- Character set to use for converting between the
 		 encoding is used for user visible filename and 16 bit
 		 Unicode characters. Long filenames are stored on disk
 		 in Unicode format, but Unix for the most part doesn't
 		 know how to deal with Unicode.
-		 By default, FAT_DEFAULT_IOCHARSET setting is used.
-
 		 There is also an option of doing UTF8 translations
 		 with the utf8 option.
 
+		 NOTE: If this option was not specified, the file name
+		 may not be read/written rightly, also filesystem is
+		 mounted as read-only.
+
 		 NOTE: "iocharset=utf8" is not recommended. If unsure,
 		 you should consider the following option instead.
 

_