aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2013-03-02 22:39:14 -0500
committerEric W. Biederman <ebiederm@xmission.com>2013-03-03 22:36:31 -0500
commit7f78e0351394052e1a6293e175825eb5c7869507 (patch)
tree76493af33d02bd3f411e69f95b0bcdfff50412b4
parentba0e3427b03c3d1550239779eca5c1c5a53a2152 (diff)
fs: Limit sys_mount to only request filesystem modules.
Modify the request_module to prefix the file system type with "fs-" and add aliases to all of the filesystems that can be built as modules to match. A common practice is to build all of the kernel code and leave code that is not commonly needed as modules, with the result that many users are exposed to any bug anywhere in the kernel. Looking for filesystems with a fs- prefix limits the pool of possible modules that can be loaded by mount to just filesystems trivially making things safer with no real cost. Using aliases means user space can control the policy of which filesystem modules are auto-loaded by editing /etc/modprobe.d/*.conf with blacklist and alias directives. Allowing simple, safe, well understood work-arounds to known problematic software. This also addresses a rare but unfortunate problem where the filesystem name is not the same as it's module name and module auto-loading would not work. While writing this patch I saw a handful of such cases. The most significant being autofs that lives in the module autofs4. This is relevant to user namespaces because we can reach the request module in get_fs_type() without having any special permissions, and people get uncomfortable when a user specified string (in this case the filesystem type) goes all of the way to request_module. After having looked at this issue I don't think there is any particular reason to perform any filtering or permission checks beyond making it clear in the module request that we want a filesystem module. The common pattern in the kernel is to call request_module() without regards to the users permissions. In general all a filesystem module does once loaded is call register_filesystem() and go to sleep. Which means there is not much attack surface exposed by loading a filesytem module unless the filesystem is mounted. In a user namespace filesystems are not mounted unless .fs_flags = FS_USERNS_MOUNT, which most filesystems do not set today. Acked-by: Serge Hallyn <serge.hallyn@canonical.com> Acked-by: Kees Cook <keescook@chromium.org> Reported-by: Kees Cook <keescook@google.com> Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
-rw-r--r--arch/ia64/kernel/perfmon.c1
-rw-r--r--arch/powerpc/platforms/cell/spufs/inode.c1
-rw-r--r--arch/s390/hypfs/inode.c1
-rw-r--r--drivers/firmware/efivars.c1
-rw-r--r--drivers/infiniband/hw/ipath/ipath_fs.c1
-rw-r--r--drivers/infiniband/hw/qib/qib_fs.c1
-rw-r--r--drivers/misc/ibmasm/ibmasmfs.c1
-rw-r--r--drivers/mtd/mtdchar.c1
-rw-r--r--drivers/oprofile/oprofilefs.c1
-rw-r--r--drivers/staging/ccg/f_fs.c1
-rw-r--r--drivers/usb/gadget/f_fs.c1
-rw-r--r--drivers/usb/gadget/inode.c1
-rw-r--r--drivers/xen/xenfs/super.c1
-rw-r--r--fs/9p/vfs_super.c1
-rw-r--r--fs/adfs/super.c1
-rw-r--r--fs/affs/super.c1
-rw-r--r--fs/afs/super.c1
-rw-r--r--fs/autofs4/init.c1
-rw-r--r--fs/befs/linuxvfs.c1
-rw-r--r--fs/bfs/inode.c1
-rw-r--r--fs/binfmt_misc.c1
-rw-r--r--fs/btrfs/super.c1
-rw-r--r--fs/ceph/super.c1
-rw-r--r--fs/coda/inode.c1
-rw-r--r--fs/configfs/mount.c1
-rw-r--r--fs/cramfs/inode.c1
-rw-r--r--fs/debugfs/inode.c1
-rw-r--r--fs/devpts/inode.c1
-rw-r--r--fs/ecryptfs/main.c1
-rw-r--r--fs/efs/super.c1
-rw-r--r--fs/exofs/super.c1
-rw-r--r--fs/ext2/super.c1
-rw-r--r--fs/ext3/super.c1
-rw-r--r--fs/ext4/super.c5
-rw-r--r--fs/f2fs/super.c1
-rw-r--r--fs/fat/namei_msdos.c1
-rw-r--r--fs/fat/namei_vfat.c1
-rw-r--r--fs/filesystems.c2
-rw-r--r--fs/freevxfs/vxfs_super.c2
-rw-r--r--fs/fuse/control.c1
-rw-r--r--fs/fuse/inode.c2
-rw-r--r--fs/gfs2/ops_fstype.c4
-rw-r--r--fs/hfs/super.c1
-rw-r--r--fs/hfsplus/super.c1
-rw-r--r--fs/hppfs/hppfs.c1
-rw-r--r--fs/hugetlbfs/inode.c1
-rw-r--r--fs/isofs/inode.c3
-rw-r--r--fs/jffs2/super.c1
-rw-r--r--fs/jfs/super.c1
-rw-r--r--fs/logfs/super.c1
-rw-r--r--fs/minix/inode.c1
-rw-r--r--fs/ncpfs/inode.c1
-rw-r--r--fs/nfs/super.c3
-rw-r--r--fs/nfsd/nfsctl.c1
-rw-r--r--fs/nilfs2/super.c1
-rw-r--r--fs/ntfs/super.c1
-rw-r--r--fs/ocfs2/dlmfs/dlmfs.c1
-rw-r--r--fs/omfs/inode.c1
-rw-r--r--fs/openpromfs/inode.c1
-rw-r--r--fs/qnx4/inode.c1
-rw-r--r--fs/qnx6/inode.c1
-rw-r--r--fs/reiserfs/super.c1
-rw-r--r--fs/romfs/super.c1
-rw-r--r--fs/sysv/super.c3
-rw-r--r--fs/ubifs/super.c1
-rw-r--r--fs/ufs/super.c1
-rw-r--r--fs/xfs/xfs_super.c1
-rw-r--r--include/linux/fs.h2
-rw-r--r--net/sunrpc/rpc_pipe.c4
69 files changed, 77 insertions, 12 deletions
diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c
index 433f5e8a2cd1..2eda28414abb 100644
--- a/arch/ia64/kernel/perfmon.c
+++ b/arch/ia64/kernel/perfmon.c
@@ -619,6 +619,7 @@ static struct file_system_type pfm_fs_type = {
619 .mount = pfmfs_mount, 619 .mount = pfmfs_mount,
620 .kill_sb = kill_anon_super, 620 .kill_sb = kill_anon_super,
621}; 621};
622MODULE_ALIAS_FS("pfmfs");
622 623
623DEFINE_PER_CPU(unsigned long, pfm_syst_info); 624DEFINE_PER_CPU(unsigned long, pfm_syst_info);
624DEFINE_PER_CPU(struct task_struct *, pmu_owner); 625DEFINE_PER_CPU(struct task_struct *, pmu_owner);
diff --git a/arch/powerpc/platforms/cell/spufs/inode.c b/arch/powerpc/platforms/cell/spufs/inode.c
index 863184b182f4..3f3bb4cdbbec 100644
--- a/arch/powerpc/platforms/cell/spufs/inode.c
+++ b/arch/powerpc/platforms/cell/spufs/inode.c
@@ -749,6 +749,7 @@ static struct file_system_type spufs_type = {
749 .mount = spufs_mount, 749 .mount = spufs_mount,
750 .kill_sb = kill_litter_super, 750 .kill_sb = kill_litter_super,
751}; 751};
752MODULE_ALIAS_FS("spufs");
752 753
753static int __init spufs_init(void) 754static int __init spufs_init(void)
754{ 755{
diff --git a/arch/s390/hypfs/inode.c b/arch/s390/hypfs/inode.c
index 8538015ed4a0..5f7d7ba2874c 100644
--- a/arch/s390/hypfs/inode.c
+++ b/arch/s390/hypfs/inode.c
@@ -456,6 +456,7 @@ static struct file_system_type hypfs_type = {
456 .mount = hypfs_mount, 456 .mount = hypfs_mount,
457 .kill_sb = hypfs_kill_super 457 .kill_sb = hypfs_kill_super
458}; 458};
459MODULE_ALIAS_FS("s390_hypfs");
459 460
460static const struct super_operations hypfs_s_ops = { 461static const struct super_operations hypfs_s_ops = {
461 .statfs = simple_statfs, 462 .statfs = simple_statfs,
diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c
index 7320bf891706..3edade07b249 100644
--- a/drivers/firmware/efivars.c
+++ b/drivers/firmware/efivars.c
@@ -1234,6 +1234,7 @@ static struct file_system_type efivarfs_type = {
1234 .mount = efivarfs_mount, 1234 .mount = efivarfs_mount,
1235 .kill_sb = efivarfs_kill_sb, 1235 .kill_sb = efivarfs_kill_sb,
1236}; 1236};
1237MODULE_ALIAS_FS("efivarfs");
1237 1238
1238/* 1239/*
1239 * Handle negative dentry. 1240 * Handle negative dentry.
diff --git a/drivers/infiniband/hw/ipath/ipath_fs.c b/drivers/infiniband/hw/ipath/ipath_fs.c
index a479375a8fd8..e0c404bdc4a8 100644
--- a/drivers/infiniband/hw/ipath/ipath_fs.c
+++ b/drivers/infiniband/hw/ipath/ipath_fs.c
@@ -410,6 +410,7 @@ static struct file_system_type ipathfs_fs_type = {
410 .mount = ipathfs_mount, 410 .mount = ipathfs_mount,
411 .kill_sb = ipathfs_kill_super, 411 .kill_sb = ipathfs_kill_super,
412}; 412};
413MODULE_ALIAS_FS("ipathfs");
413 414
414int __init ipath_init_ipathfs(void) 415int __init ipath_init_ipathfs(void)
415{ 416{
diff --git a/drivers/infiniband/hw/qib/qib_fs.c b/drivers/infiniband/hw/qib/qib_fs.c
index 644bd6f6467c..f247fc6e6182 100644
--- a/drivers/infiniband/hw/qib/qib_fs.c
+++ b/drivers/infiniband/hw/qib/qib_fs.c
@@ -604,6 +604,7 @@ static struct file_system_type qibfs_fs_type = {
604 .mount = qibfs_mount, 604 .mount = qibfs_mount,
605 .kill_sb = qibfs_kill_super, 605 .kill_sb = qibfs_kill_super,
606}; 606};
607MODULE_ALIAS_FS("ipathfs");
607 608
608int __init qib_init_qibfs(void) 609int __init qib_init_qibfs(void)
609{ 610{
diff --git a/drivers/misc/ibmasm/ibmasmfs.c b/drivers/misc/ibmasm/ibmasmfs.c
index 6673e578b3e9..ce5b75616b45 100644
--- a/drivers/misc/ibmasm/ibmasmfs.c
+++ b/drivers/misc/ibmasm/ibmasmfs.c
@@ -110,6 +110,7 @@ static struct file_system_type ibmasmfs_type = {
110 .mount = ibmasmfs_mount, 110 .mount = ibmasmfs_mount,
111 .kill_sb = kill_litter_super, 111 .kill_sb = kill_litter_super,
112}; 112};
113MODULE_ALIAS_FS("ibmasmfs");
113 114
114static int ibmasmfs_fill_super (struct super_block *sb, void *data, int silent) 115static int ibmasmfs_fill_super (struct super_block *sb, void *data, int silent)
115{ 116{
diff --git a/drivers/mtd/mtdchar.c b/drivers/mtd/mtdchar.c
index 82c06165d3d2..92ab30ab00dc 100644
--- a/drivers/mtd/mtdchar.c
+++ b/drivers/mtd/mtdchar.c
@@ -1238,6 +1238,7 @@ static struct file_system_type mtd_inodefs_type = {
1238 .mount = mtd_inodefs_mount, 1238 .mount = mtd_inodefs_mount,
1239 .kill_sb = kill_anon_super, 1239 .kill_sb = kill_anon_super,
1240}; 1240};
1241MODULE_ALIAS_FS("mtd_inodefs");
1241 1242
1242static int __init init_mtdchar(void) 1243static int __init init_mtdchar(void)
1243{ 1244{
diff --git a/drivers/oprofile/oprofilefs.c b/drivers/oprofile/oprofilefs.c
index 445ffda715ad..7c12d9c2b230 100644
--- a/drivers/oprofile/oprofilefs.c
+++ b/drivers/oprofile/oprofilefs.c
@@ -276,6 +276,7 @@ static struct file_system_type oprofilefs_type = {
276 .mount = oprofilefs_mount, 276 .mount = oprofilefs_mount,
277 .kill_sb = kill_litter_super, 277 .kill_sb = kill_litter_super,
278}; 278};
279MODULE_ALIAS_FS("oprofilefs");
279 280
280 281
281int __init oprofilefs_register(void) 282int __init oprofilefs_register(void)
diff --git a/drivers/staging/ccg/f_fs.c b/drivers/staging/ccg/f_fs.c
index 8adc79d1b402..f6373dade7fb 100644
--- a/drivers/staging/ccg/f_fs.c
+++ b/drivers/staging/ccg/f_fs.c
@@ -1223,6 +1223,7 @@ static struct file_system_type ffs_fs_type = {
1223 .mount = ffs_fs_mount, 1223 .mount = ffs_fs_mount,
1224 .kill_sb = ffs_fs_kill_sb, 1224 .kill_sb = ffs_fs_kill_sb,
1225}; 1225};
1226MODULE_ALIAS_FS("functionfs");
1226 1227
1227 1228
1228/* Driver's main init/cleanup functions *************************************/ 1229/* Driver's main init/cleanup functions *************************************/
diff --git a/drivers/usb/gadget/f_fs.c b/drivers/usb/gadget/f_fs.c
index 38388d7844fc..c377ff84bf2c 100644
--- a/drivers/usb/gadget/f_fs.c
+++ b/drivers/usb/gadget/f_fs.c
@@ -1235,6 +1235,7 @@ static struct file_system_type ffs_fs_type = {
1235 .mount = ffs_fs_mount, 1235 .mount = ffs_fs_mount,
1236 .kill_sb = ffs_fs_kill_sb, 1236 .kill_sb = ffs_fs_kill_sb,
1237}; 1237};
1238MODULE_ALIAS_FS("functionfs");
1238 1239
1239 1240
1240/* Driver's main init/cleanup functions *************************************/ 1241/* Driver's main init/cleanup functions *************************************/
diff --git a/drivers/usb/gadget/inode.c b/drivers/usb/gadget/inode.c
index 8ac840f25ba9..e2b2e9cf254a 100644
--- a/drivers/usb/gadget/inode.c
+++ b/drivers/usb/gadget/inode.c
@@ -2105,6 +2105,7 @@ static struct file_system_type gadgetfs_type = {
2105 .mount = gadgetfs_mount, 2105 .mount = gadgetfs_mount,
2106 .kill_sb = gadgetfs_kill_sb, 2106 .kill_sb = gadgetfs_kill_sb,
2107}; 2107};
2108MODULE_ALIAS_FS("gadgetfs");
2108 2109
2109/*----------------------------------------------------------------------*/ 2110/*----------------------------------------------------------------------*/
2110 2111
diff --git a/drivers/xen/xenfs/super.c b/drivers/xen/xenfs/super.c
index ec0abb6df3c3..71679875f056 100644
--- a/drivers/xen/xenfs/super.c
+++ b/drivers/xen/xenfs/super.c
@@ -75,6 +75,7 @@ static struct file_system_type xenfs_type = {
75 .mount = xenfs_mount, 75 .mount = xenfs_mount,
76 .kill_sb = kill_litter_super, 76 .kill_sb = kill_litter_super,
77}; 77};
78MODULE_ALIAS_FS("xenfs");
78 79
79static int __init xenfs_init(void) 80static int __init xenfs_init(void)
80{ 81{
diff --git a/fs/9p/vfs_super.c b/fs/9p/vfs_super.c
index 91dad63e5a2d..2756dcd5de6e 100644
--- a/fs/9p/vfs_super.c
+++ b/fs/9p/vfs_super.c
@@ -365,3 +365,4 @@ struct file_system_type v9fs_fs_type = {
365 .owner = THIS_MODULE, 365 .owner = THIS_MODULE,
366 .fs_flags = FS_RENAME_DOES_D_MOVE, 366 .fs_flags = FS_RENAME_DOES_D_MOVE,
367}; 367};
368MODULE_ALIAS_FS("9p");
diff --git a/fs/adfs/super.c b/fs/adfs/super.c
index d57122935793..0ff4bae2c2a2 100644
--- a/fs/adfs/super.c
+++ b/fs/adfs/super.c
@@ -524,6 +524,7 @@ static struct file_system_type adfs_fs_type = {
524 .kill_sb = kill_block_super, 524 .kill_sb = kill_block_super,
525 .fs_flags = FS_REQUIRES_DEV, 525 .fs_flags = FS_REQUIRES_DEV,
526}; 526};
527MODULE_ALIAS_FS("adfs");
527 528
528static int __init init_adfs_fs(void) 529static int __init init_adfs_fs(void)
529{ 530{
diff --git a/fs/affs/super.c b/fs/affs/super.c
index b84dc7352502..45161a832bbc 100644
--- a/fs/affs/super.c
+++ b/fs/affs/super.c
@@ -622,6 +622,7 @@ static struct file_system_type affs_fs_type = {
622 .kill_sb = kill_block_super, 622 .kill_sb = kill_block_super,
623 .fs_flags = FS_REQUIRES_DEV, 623 .fs_flags = FS_REQUIRES_DEV,
624}; 624};
625MODULE_ALIAS_FS("affs");
625 626
626static int __init init_affs_fs(void) 627static int __init init_affs_fs(void)
627{ 628{
diff --git a/fs/afs/super.c b/fs/afs/super.c
index 7c31ec399575..c4861557e385 100644
--- a/fs/afs/super.c
+++ b/fs/afs/super.c
@@ -45,6 +45,7 @@ struct file_system_type afs_fs_type = {
45 .kill_sb = afs_kill_super, 45 .kill_sb = afs_kill_super,
46 .fs_flags = 0, 46 .fs_flags = 0,
47}; 47};
48MODULE_ALIAS_FS("afs");
48 49
49static const struct super_operations afs_super_ops = { 50static const struct super_operations afs_super_ops = {
50 .statfs = afs_statfs, 51 .statfs = afs_statfs,
diff --git a/fs/autofs4/init.c b/fs/autofs4/init.c
index cddc74b9cdb2..b3db517e89ec 100644
--- a/fs/autofs4/init.c
+++ b/fs/autofs4/init.c
@@ -26,6 +26,7 @@ static struct file_system_type autofs_fs_type = {
26 .mount = autofs_mount, 26 .mount = autofs_mount,
27 .kill_sb = autofs4_kill_sb, 27 .kill_sb = autofs4_kill_sb,
28}; 28};
29MODULE_ALIAS_FS("autofs");
29 30
30static int __init init_autofs4_fs(void) 31static int __init init_autofs4_fs(void)
31{ 32{
diff --git a/fs/befs/linuxvfs.c b/fs/befs/linuxvfs.c
index c8f4e25eb9e2..8615ee89ab55 100644
--- a/fs/befs/linuxvfs.c
+++ b/fs/befs/linuxvfs.c
@@ -951,6 +951,7 @@ static struct file_system_type befs_fs_type = {
951 .kill_sb = kill_block_super, 951 .kill_sb = kill_block_super,
952 .fs_flags = FS_REQUIRES_DEV, 952 .fs_flags = FS_REQUIRES_DEV,
953}; 953};
954MODULE_ALIAS_FS("befs");
954 955
955static int __init 956static int __init
956init_befs_fs(void) 957init_befs_fs(void)
diff --git a/fs/bfs/inode.c b/fs/bfs/inode.c
index 737aaa3f7090..5e376bb93419 100644
--- a/fs/bfs/inode.c
+++ b/fs/bfs/inode.c
@@ -473,6 +473,7 @@ static struct file_system_type bfs_fs_type = {
473 .kill_sb = kill_block_super, 473 .kill_sb = kill_block_super,
474 .fs_flags = FS_REQUIRES_DEV, 474 .fs_flags = FS_REQUIRES_DEV,
475}; 475};
476MODULE_ALIAS_FS("bfs");
476 477
477static int __init init_bfs_fs(void) 478static int __init init_bfs_fs(void)
478{ 479{
diff --git a/fs/binfmt_misc.c b/fs/binfmt_misc.c
index fecbbf3f8ff2..751df5e4f61a 100644
--- a/fs/binfmt_misc.c
+++ b/fs/binfmt_misc.c
@@ -720,6 +720,7 @@ static struct file_system_type bm_fs_type = {
720 .mount = bm_mount, 720 .mount = bm_mount,
721 .kill_sb = kill_litter_super, 721 .kill_sb = kill_litter_super,
722}; 722};
723MODULE_ALIAS_FS("binfmt_misc");
723 724
724static int __init init_misc_binfmt(void) 725static int __init init_misc_binfmt(void)
725{ 726{
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index 68a29a1ea068..f6b88595f858 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -1558,6 +1558,7 @@ static struct file_system_type btrfs_fs_type = {
1558 .kill_sb = btrfs_kill_super, 1558 .kill_sb = btrfs_kill_super,
1559 .fs_flags = FS_REQUIRES_DEV, 1559 .fs_flags = FS_REQUIRES_DEV,
1560}; 1560};
1561MODULE_ALIAS_FS("btrfs");
1561 1562
1562/* 1563/*
1563 * used by btrfsctl to scan devices when no FS is mounted 1564 * used by btrfsctl to scan devices when no FS is mounted
diff --git a/fs/ceph/super.c b/fs/ceph/super.c
index 9fe17c6c2876..6ddc0bca56b2 100644
--- a/fs/ceph/super.c
+++ b/fs/ceph/super.c
@@ -952,6 +952,7 @@ static struct file_system_type ceph_fs_type = {
952 .kill_sb = ceph_kill_sb, 952 .kill_sb = ceph_kill_sb,
953 .fs_flags = FS_RENAME_DOES_D_MOVE, 953 .fs_flags = FS_RENAME_DOES_D_MOVE,
954}; 954};
955MODULE_ALIAS_FS("ceph");
955 956
956#define _STRINGIFY(x) #x 957#define _STRINGIFY(x) #x
957#define STRINGIFY(x) _STRINGIFY(x) 958#define STRINGIFY(x) _STRINGIFY(x)
diff --git a/fs/coda/inode.c b/fs/coda/inode.c
index dada9d0abede..4dcc0d81a7aa 100644
--- a/fs/coda/inode.c
+++ b/fs/coda/inode.c
@@ -329,4 +329,5 @@ struct file_system_type coda_fs_type = {
329 .kill_sb = kill_anon_super, 329 .kill_sb = kill_anon_super,
330 .fs_flags = FS_BINARY_MOUNTDATA, 330 .fs_flags = FS_BINARY_MOUNTDATA,
331}; 331};
332MODULE_ALIAS_FS("coda");
332 333
diff --git a/fs/configfs/mount.c b/fs/configfs/mount.c
index aee0a7ebbd8e..7f26c3cf75ae 100644
--- a/fs/configfs/mount.c
+++ b/fs/configfs/mount.c
@@ -114,6 +114,7 @@ static struct file_system_type configfs_fs_type = {
114 .mount = configfs_do_mount, 114 .mount = configfs_do_mount,
115 .kill_sb = kill_litter_super, 115 .kill_sb = kill_litter_super,
116}; 116};
117MODULE_ALIAS_FS("configfs");
117 118
118struct dentry *configfs_pin_fs(void) 119struct dentry *configfs_pin_fs(void)
119{ 120{
diff --git a/fs/cramfs/inode.c b/fs/cramfs/inode.c
index 3ceb9ec976e1..35b1c7bd18b7 100644
--- a/fs/cramfs/inode.c
+++ b/fs/cramfs/inode.c
@@ -573,6 +573,7 @@ static struct file_system_type cramfs_fs_type = {
573 .kill_sb = kill_block_super, 573 .kill_sb = kill_block_super,
574 .fs_flags = FS_REQUIRES_DEV, 574 .fs_flags = FS_REQUIRES_DEV,
575}; 575};
576MODULE_ALIAS_FS("cramfs");
576 577
577static int __init init_cramfs_fs(void) 578static int __init init_cramfs_fs(void)
578{ 579{
diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c
index 0c4f80b447fb..4888cb3fdef7 100644
--- a/fs/debugfs/inode.c
+++ b/fs/debugfs/inode.c
@@ -299,6 +299,7 @@ static struct file_system_type debug_fs_type = {
299 .mount = debug_mount, 299 .mount = debug_mount,
300 .kill_sb = kill_litter_super, 300 .kill_sb = kill_litter_super,
301}; 301};
302MODULE_ALIAS_FS("debugfs");
302 303
303static struct dentry *__create_file(const char *name, umode_t mode, 304static struct dentry *__create_file(const char *name, umode_t mode,
304 struct dentry *parent, void *data, 305 struct dentry *parent, void *data,
diff --git a/fs/devpts/inode.c b/fs/devpts/inode.c
index 073d30b9d1ac..79b662985efe 100644
--- a/fs/devpts/inode.c
+++ b/fs/devpts/inode.c
@@ -510,6 +510,7 @@ static struct file_system_type devpts_fs_type = {
510 .fs_flags = FS_USERNS_MOUNT | FS_USERNS_DEV_MOUNT, 510 .fs_flags = FS_USERNS_MOUNT | FS_USERNS_DEV_MOUNT,
511#endif 511#endif
512}; 512};
513MODULE_ALIAS_FS("devpts");
513 514
514/* 515/*
515 * The normal naming convention is simply /dev/pts/<number>; this conforms 516 * The normal naming convention is simply /dev/pts/<number>; this conforms
diff --git a/fs/ecryptfs/main.c b/fs/ecryptfs/main.c
index 4e0886c9e5c4..e924cf45aad9 100644
--- a/fs/ecryptfs/main.c
+++ b/fs/ecryptfs/main.c
@@ -629,6 +629,7 @@ static struct file_system_type ecryptfs_fs_type = {
629 .kill_sb = ecryptfs_kill_block_super, 629 .kill_sb = ecryptfs_kill_block_super,
630 .fs_flags = 0 630 .fs_flags = 0
631}; 631};
632MODULE_ALIAS_FS("ecryptfs");
632 633
633/** 634/**
634 * inode_info_init_once 635 * inode_info_init_once
diff --git a/fs/efs/super.c b/fs/efs/super.c
index 2002431ef9a0..c6f57a74a559 100644
--- a/fs/efs/super.c
+++ b/fs/efs/super.c
@@ -33,6 +33,7 @@ static struct file_system_type efs_fs_type = {
33 .kill_sb = kill_block_super, 33 .kill_sb = kill_block_super,
34 .fs_flags = FS_REQUIRES_DEV, 34 .fs_flags = FS_REQUIRES_DEV,
35}; 35};
36MODULE_ALIAS_FS("efs");
36 37
37static struct pt_types sgi_pt_types[] = { 38static struct pt_types sgi_pt_types[] = {
38 {0x00, "SGI vh"}, 39 {0x00, "SGI vh"},
diff --git a/fs/exofs/super.c b/fs/exofs/super.c
index 5e59280d42d7..9d9763328734 100644
--- a/fs/exofs/super.c
+++ b/fs/exofs/super.c
@@ -1010,6 +1010,7 @@ static struct file_system_type exofs_type = {
1010 .mount = exofs_mount, 1010 .mount = exofs_mount,
1011 .kill_sb = generic_shutdown_super, 1011 .kill_sb = generic_shutdown_super,
1012}; 1012};
1013MODULE_ALIAS_FS("exofs");
1013 1014
1014static int __init init_exofs(void) 1015static int __init init_exofs(void)
1015{ 1016{
diff --git a/fs/ext2/super.c b/fs/ext2/super.c
index 7f68c8114026..288534920fe5 100644
--- a/fs/ext2/super.c
+++ b/fs/ext2/super.c
@@ -1536,6 +1536,7 @@ static struct file_system_type ext2_fs_type = {
1536 .kill_sb = kill_block_super, 1536 .kill_sb = kill_block_super,
1537 .fs_flags = FS_REQUIRES_DEV, 1537 .fs_flags = FS_REQUIRES_DEV,
1538}; 1538};
1539MODULE_ALIAS_FS("ext2");
1539 1540
1540static int __init init_ext2_fs(void) 1541static int __init init_ext2_fs(void)
1541{ 1542{
diff --git a/fs/ext3/super.c b/fs/ext3/super.c
index 5546ca225ffe..1d6e2ed85322 100644
--- a/fs/ext3/super.c
+++ b/fs/ext3/super.c
@@ -3068,6 +3068,7 @@ static struct file_system_type ext3_fs_type = {
3068 .kill_sb = kill_block_super, 3068 .kill_sb = kill_block_super,
3069 .fs_flags = FS_REQUIRES_DEV, 3069 .fs_flags = FS_REQUIRES_DEV,
3070}; 3070};
3071MODULE_ALIAS_FS("ext3");
3071 3072
3072static int __init init_ext3_fs(void) 3073static int __init init_ext3_fs(void)
3073{ 3074{
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 5e6c87836193..34e855219231 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -90,6 +90,7 @@ static struct file_system_type ext2_fs_type = {
90 .kill_sb = kill_block_super, 90 .kill_sb = kill_block_super,
91 .fs_flags = FS_REQUIRES_DEV, 91 .fs_flags = FS_REQUIRES_DEV,
92}; 92};
93MODULE_ALIAS_FS("ext2");
93#define IS_EXT2_SB(sb) ((sb)->s_bdev->bd_holder == &ext2_fs_type) 94#define IS_EXT2_SB(sb) ((sb)->s_bdev->bd_holder == &ext2_fs_type)
94#else 95#else
95#define IS_EXT2_SB(sb) (0) 96#define IS_EXT2_SB(sb) (0)
@@ -104,6 +105,7 @@ static struct file_system_type ext3_fs_type = {
104 .kill_sb = kill_block_super, 105 .kill_sb = kill_block_super,
105 .fs_flags = FS_REQUIRES_DEV, 106 .fs_flags = FS_REQUIRES_DEV,
106}; 107};
108MODULE_ALIAS_FS("ext3");
107#define IS_EXT3_SB(sb) ((sb)->s_bdev->bd_holder == &ext3_fs_type) 109#define IS_EXT3_SB(sb) ((sb)->s_bdev->bd_holder == &ext3_fs_type)
108#else 110#else
109#define IS_EXT3_SB(sb) (0) 111#define IS_EXT3_SB(sb) (0)
@@ -5152,7 +5154,6 @@ static inline int ext2_feature_set_ok(struct super_block *sb)
5152 return 0; 5154 return 0;
5153 return 1; 5155 return 1;
5154} 5156}
5155MODULE_ALIAS("ext2");
5156#else 5157#else
5157static inline void register_as_ext2(void) { } 5158static inline void register_as_ext2(void) { }
5158static inline void unregister_as_ext2(void) { } 5159static inline void unregister_as_ext2(void) { }
@@ -5185,7 +5186,6 @@ static inline int ext3_feature_set_ok(struct super_block *sb)
5185 return 0; 5186 return 0;
5186 return 1; 5187 return 1;
5187} 5188}
5188MODULE_ALIAS("ext3");
5189#else 5189#else
5190static inline void register_as_ext3(void) { } 5190static inline void register_as_ext3(void) { }
5191static inline void unregister_as_ext3(void) { } 5191static inline void unregister_as_ext3(void) { }
@@ -5199,6 +5199,7 @@ static struct file_system_type ext4_fs_type = {
5199 .kill_sb = kill_block_super, 5199 .kill_sb = kill_block_super,
5200 .fs_flags = FS_REQUIRES_DEV, 5200 .fs_flags = FS_REQUIRES_DEV,
5201}; 5201};
5202MODULE_ALIAS_FS("ext4");
5202 5203
5203static int __init ext4_init_feat_adverts(void) 5204static int __init ext4_init_feat_adverts(void)
5204{ 5205{
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 8c117649a035..fea6e582a2ed 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -687,6 +687,7 @@ static struct file_system_type f2fs_fs_type = {
687 .kill_sb = kill_block_super, 687 .kill_sb = kill_block_super,
688 .fs_flags = FS_REQUIRES_DEV, 688 .fs_flags = FS_REQUIRES_DEV,
689}; 689};
690MODULE_ALIAS_FS("f2fs");
690 691
691static int __init init_inodecache(void) 692static int __init init_inodecache(void)
692{ 693{
diff --git a/fs/fat/namei_msdos.c b/fs/fat/namei_msdos.c
index e2cfda94a28d..081b759cff83 100644
--- a/fs/fat/namei_msdos.c
+++ b/fs/fat/namei_msdos.c
@@ -668,6 +668,7 @@ static struct file_system_type msdos_fs_type = {
668 .kill_sb = kill_block_super, 668 .kill_sb = kill_block_super,
669 .fs_flags = FS_REQUIRES_DEV, 669 .fs_flags = FS_REQUIRES_DEV,
670}; 670};
671MODULE_ALIAS_FS("msdos");
671 672
672static int __init init_msdos_fs(void) 673static int __init init_msdos_fs(void)
673{ 674{
diff --git a/fs/fat/namei_vfat.c b/fs/fat/namei_vfat.c
index ac959d655e7d..2da952036a3d 100644
--- a/fs/fat/namei_vfat.c
+++ b/fs/fat/namei_vfat.c
@@ -1073,6 +1073,7 @@ static struct file_system_type vfat_fs_type = {
1073 .kill_sb = kill_block_super, 1073 .kill_sb = kill_block_super,
1074 .fs_flags = FS_REQUIRES_DEV, 1074 .fs_flags = FS_REQUIRES_DEV,
1075}; 1075};
1076MODULE_ALIAS_FS("vfat");
1076 1077
1077static int __init init_vfat_fs(void) 1078static int __init init_vfat_fs(void)
1078{ 1079{
diff --git a/fs/filesystems.c b/fs/filesystems.c
index da165f6adcbf..92567d95ba6a 100644
--- a/fs/filesystems.c
+++ b/fs/filesystems.c
@@ -273,7 +273,7 @@ struct file_system_type *get_fs_type(const char *name)
273 int len = dot ? dot - name : strlen(name); 273 int len = dot ? dot - name : strlen(name);
274 274
275 fs = __get_fs_type(name, len); 275 fs = __get_fs_type(name, len);
276 if (!fs && (request_module("%.*s", len, name) == 0)) 276 if (!fs && (request_module("fs-%.*s", len, name) == 0))
277 fs = __get_fs_type(name, len); 277 fs = __get_fs_type(name, len);
278 278
279 if (dot && fs && !(fs->fs_flags & FS_HAS_SUBTYPE)) { 279 if (dot && fs && !(fs->fs_flags & FS_HAS_SUBTYPE)) {
diff --git a/fs/freevxfs/vxfs_super.c b/fs/freevxfs/vxfs_super.c
index fed2c8afb3a9..455074308069 100644
--- a/fs/freevxfs/vxfs_super.c
+++ b/fs/freevxfs/vxfs_super.c
@@ -52,7 +52,6 @@ MODULE_AUTHOR("Christoph Hellwig");
52MODULE_DESCRIPTION("Veritas Filesystem (VxFS) driver"); 52MODULE_DESCRIPTION("Veritas Filesystem (VxFS) driver");
53MODULE_LICENSE("Dual BSD/GPL"); 53MODULE_LICENSE("Dual BSD/GPL");
54 54
55MODULE_ALIAS("vxfs"); /* makes mount -t vxfs autoload the module */
56 55
57 56
58static void vxfs_put_super(struct super_block *); 57static void vxfs_put_super(struct super_block *);
@@ -258,6 +257,7 @@ static struct file_system_type vxfs_fs_type = {
258 .kill_sb = kill_block_super, 257 .kill_sb = kill_block_super,
259 .fs_flags = FS_REQUIRES_DEV, 258 .fs_flags = FS_REQUIRES_DEV,
260}; 259};
260MODULE_ALIAS_FS("vxfs"); /* makes mount -t vxfs autoload the module */
261 261
262static int __init 262static int __init
263vxfs_init(void) 263vxfs_init(void)
diff --git a/fs/fuse/control.c b/fs/fuse/control.c
index b7978b9f75ef..a0b0855d00a9 100644
--- a/fs/fuse/control.c
+++ b/fs/fuse/control.c
@@ -341,6 +341,7 @@ static struct file_system_type fuse_ctl_fs_type = {
341 .mount = fuse_ctl_mount, 341 .mount = fuse_ctl_mount,
342 .kill_sb = fuse_ctl_kill_sb, 342 .kill_sb = fuse_ctl_kill_sb,
343}; 343};
344MODULE_ALIAS_FS("fusectl");
344 345
345int __init fuse_ctl_init(void) 346int __init fuse_ctl_init(void)
346{ 347{
diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
index df00993ed108..137185c3884f 100644
--- a/fs/fuse/inode.c
+++ b/fs/fuse/inode.c
@@ -1117,6 +1117,7 @@ static struct file_system_type fuse_fs_type = {
1117 .mount = fuse_mount, 1117 .mount = fuse_mount,
1118 .kill_sb = fuse_kill_sb_anon, 1118 .kill_sb = fuse_kill_sb_anon,
1119}; 1119};
1120MODULE_ALIAS_FS("fuse");
1120 1121
1121#ifdef CONFIG_BLOCK 1122#ifdef CONFIG_BLOCK
1122static struct dentry *fuse_mount_blk(struct file_system_type *fs_type, 1123static struct dentry *fuse_mount_blk(struct file_system_type *fs_type,
@@ -1146,6 +1147,7 @@ static struct file_system_type fuseblk_fs_type = {
1146 .kill_sb = fuse_kill_sb_blk, 1147 .kill_sb = fuse_kill_sb_blk,
1147 .fs_flags = FS_REQUIRES_DEV | FS_HAS_SUBTYPE, 1148 .fs_flags = FS_REQUIRES_DEV | FS_HAS_SUBTYPE,
1148}; 1149};
1150MODULE_ALIAS_FS("fuseblk");
1149 1151
1150static inline int register_fuseblk(void) 1152static inline int register_fuseblk(void)
1151{ 1153{
diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c
index 1b612be4b873..60ede2a0f43f 100644
--- a/fs/gfs2/ops_fstype.c
+++ b/fs/gfs2/ops_fstype.c
@@ -20,6 +20,7 @@
20#include <linux/gfs2_ondisk.h> 20#include <linux/gfs2_ondisk.h>
21#include <linux/quotaops.h> 21#include <linux/quotaops.h>
22#include <linux/lockdep.h> 22#include <linux/lockdep.h>
23#include <linux/module.h>
23 24
24#include "gfs2.h" 25#include "gfs2.h"
25#include "incore.h" 26#include "incore.h"
@@ -1425,6 +1426,7 @@ struct file_system_type gfs2_fs_type = {
1425 .kill_sb = gfs2_kill_sb, 1426 .kill_sb = gfs2_kill_sb,
1426 .owner = THIS_MODULE, 1427 .owner = THIS_MODULE,
1427}; 1428};
1429MODULE_ALIAS_FS("gfs2");
1428 1430
1429struct file_system_type gfs2meta_fs_type = { 1431struct file_system_type gfs2meta_fs_type = {
1430 .name = "gfs2meta", 1432 .name = "gfs2meta",
@@ -1432,4 +1434,4 @@ struct file_system_type gfs2meta_fs_type = {
1432 .mount = gfs2_mount_meta, 1434 .mount = gfs2_mount_meta,
1433 .owner = THIS_MODULE, 1435 .owner = THIS_MODULE,
1434}; 1436};
1435 1437MODULE_ALIAS_FS("gfs2meta");
diff --git a/fs/hfs/super.c b/fs/hfs/super.c
index e93ddaadfd1e..bbaaa8a4ee64 100644
--- a/fs/hfs/super.c
+++ b/fs/hfs/super.c
@@ -466,6 +466,7 @@ static struct file_system_type hfs_fs_type = {
466 .kill_sb = kill_block_super, 466 .kill_sb = kill_block_super,
467 .fs_flags = FS_REQUIRES_DEV, 467 .fs_flags = FS_REQUIRES_DEV,
468}; 468};
469MODULE_ALIAS_FS("hfs");
469 470
470static void hfs_init_once(void *p) 471static void hfs_init_once(void *p)
471{ 472{
diff --git a/fs/hfsplus/super.c b/fs/hfsplus/super.c
index 974c26f96fae..7b87284e46dc 100644
--- a/fs/hfsplus/super.c
+++ b/fs/hfsplus/super.c
@@ -654,6 +654,7 @@ static struct file_system_type hfsplus_fs_type = {
654 .kill_sb = kill_block_super, 654 .kill_sb = kill_block_super,
655 .fs_flags = FS_REQUIRES_DEV, 655 .fs_flags = FS_REQUIRES_DEV,
656}; 656};
657MODULE_ALIAS_FS("hfsplus");
657 658
658static void hfsplus_init_once(void *p) 659static void hfsplus_init_once(void *p)
659{ 660{
diff --git a/fs/hppfs/hppfs.c b/fs/hppfs/hppfs.c
index 74f55703be49..126d3c2e2dee 100644
--- a/fs/hppfs/hppfs.c
+++ b/fs/hppfs/hppfs.c
@@ -748,6 +748,7 @@ static struct file_system_type hppfs_type = {
748 .kill_sb = kill_anon_super, 748 .kill_sb = kill_anon_super,
749 .fs_flags = 0, 749 .fs_flags = 0,
750}; 750};
751MODULE_ALIAS_FS("hppfs");
751 752
752static int __init init_hppfs(void) 753static int __init init_hppfs(void)
753{ 754{
diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
index 7f94e0cbc69c..84e3d856e91d 100644
--- a/fs/hugetlbfs/inode.c
+++ b/fs/hugetlbfs/inode.c
@@ -896,6 +896,7 @@ static struct file_system_type hugetlbfs_fs_type = {
896 .mount = hugetlbfs_mount, 896 .mount = hugetlbfs_mount,
897 .kill_sb = kill_litter_super, 897 .kill_sb = kill_litter_super,
898}; 898};
899MODULE_ALIAS_FS("hugetlbfs");
899 900
900static struct vfsmount *hugetlbfs_vfsmount[HUGE_MAX_HSTATE]; 901static struct vfsmount *hugetlbfs_vfsmount[HUGE_MAX_HSTATE];
901 902
diff --git a/fs/isofs/inode.c b/fs/isofs/inode.c
index 67ce52507d7d..a67f16e846a2 100644
--- a/fs/isofs/inode.c
+++ b/fs/isofs/inode.c
@@ -1556,6 +1556,7 @@ static struct file_system_type iso9660_fs_type = {
1556 .kill_sb = kill_block_super, 1556 .kill_sb = kill_block_super,
1557 .fs_flags = FS_REQUIRES_DEV, 1557 .fs_flags = FS_REQUIRES_DEV,
1558}; 1558};
1559MODULE_ALIAS_FS("iso9660");
1559 1560
1560static int __init init_iso9660_fs(void) 1561static int __init init_iso9660_fs(void)
1561{ 1562{
@@ -1593,5 +1594,3 @@ static void __exit exit_iso9660_fs(void)
1593module_init(init_iso9660_fs) 1594module_init(init_iso9660_fs)
1594module_exit(exit_iso9660_fs) 1595module_exit(exit_iso9660_fs)
1595MODULE_LICENSE("GPL"); 1596MODULE_LICENSE("GPL");
1596/* Actual filesystem name is iso9660, as requested in filesystems.c */
1597MODULE_ALIAS("iso9660");
diff --git a/fs/jffs2/super.c b/fs/jffs2/super.c
index d3d8799e2187..0defb1cc2a35 100644
--- a/fs/jffs2/super.c
+++ b/fs/jffs2/super.c
@@ -356,6 +356,7 @@ static struct file_system_type jffs2_fs_type = {
356 .mount = jffs2_mount, 356 .mount = jffs2_mount,
357 .kill_sb = jffs2_kill_sb, 357 .kill_sb = jffs2_kill_sb,
358}; 358};
359MODULE_ALIAS_FS("jffs2");
359 360
360static int __init init_jffs2_fs(void) 361static int __init init_jffs2_fs(void)
361{ 362{
diff --git a/fs/jfs/super.c b/fs/jfs/super.c
index 060ba638becb..2003e830ed1c 100644
--- a/fs/jfs/super.c
+++ b/fs/jfs/super.c
@@ -833,6 +833,7 @@ static struct file_system_type jfs_fs_type = {
833 .kill_sb = kill_block_super, 833 .kill_sb = kill_block_super,
834 .fs_flags = FS_REQUIRES_DEV, 834 .fs_flags = FS_REQUIRES_DEV,
835}; 835};
836MODULE_ALIAS_FS("jfs");
836 837
837static void init_once(void *foo) 838static void init_once(void *foo)
838{ 839{
diff --git a/fs/logfs/super.c b/fs/logfs/super.c
index 345c24b8a6f8..54360293bcb5 100644
--- a/fs/logfs/super.c
+++ b/fs/logfs/super.c
@@ -608,6 +608,7 @@ static struct file_system_type logfs_fs_type = {
608 .fs_flags = FS_REQUIRES_DEV, 608 .fs_flags = FS_REQUIRES_DEV,
609 609
610}; 610};
611MODULE_ALIAS_FS("logfs");
611 612
612static int __init logfs_init(void) 613static int __init logfs_init(void)
613{ 614{
diff --git a/fs/minix/inode.c b/fs/minix/inode.c
index 99541cceb584..df122496f328 100644
--- a/fs/minix/inode.c
+++ b/fs/minix/inode.c
@@ -660,6 +660,7 @@ static struct file_system_type minix_fs_type = {
660 .kill_sb = kill_block_super, 660 .kill_sb = kill_block_super,
661 .fs_flags = FS_REQUIRES_DEV, 661 .fs_flags = FS_REQUIRES_DEV,
662}; 662};
663MODULE_ALIAS_FS("minix");
663 664
664static int __init init_minix_fs(void) 665static int __init init_minix_fs(void)
665{ 666{
diff --git a/fs/ncpfs/inode.c b/fs/ncpfs/inode.c
index 7dafd6899a62..26910c8154da 100644
--- a/fs/ncpfs/inode.c
+++ b/fs/ncpfs/inode.c
@@ -1051,6 +1051,7 @@ static struct file_system_type ncp_fs_type = {
1051 .kill_sb = kill_anon_super, 1051 .kill_sb = kill_anon_super,
1052 .fs_flags = FS_BINARY_MOUNTDATA, 1052 .fs_flags = FS_BINARY_MOUNTDATA,
1053}; 1053};
1054MODULE_ALIAS_FS("ncpfs");
1054 1055
1055static int __init init_ncp_fs(void) 1056static int __init init_ncp_fs(void)
1056{ 1057{
diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index 17b32b722457..95cdcb208dfb 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -294,6 +294,7 @@ struct file_system_type nfs_fs_type = {
294 .kill_sb = nfs_kill_super, 294 .kill_sb = nfs_kill_super,
295 .fs_flags = FS_RENAME_DOES_D_MOVE|FS_BINARY_MOUNTDATA, 295 .fs_flags = FS_RENAME_DOES_D_MOVE|FS_BINARY_MOUNTDATA,
296}; 296};
297MODULE_ALIAS_FS("nfs");
297EXPORT_SYMBOL_GPL(nfs_fs_type); 298EXPORT_SYMBOL_GPL(nfs_fs_type);
298 299
299struct file_system_type nfs_xdev_fs_type = { 300struct file_system_type nfs_xdev_fs_type = {
@@ -333,6 +334,7 @@ struct file_system_type nfs4_fs_type = {
333 .kill_sb = nfs_kill_super, 334 .kill_sb = nfs_kill_super,
334 .fs_flags = FS_RENAME_DOES_D_MOVE|FS_BINARY_MOUNTDATA, 335 .fs_flags = FS_RENAME_DOES_D_MOVE|FS_BINARY_MOUNTDATA,
335}; 336};
337MODULE_ALIAS_FS("nfs4");
336EXPORT_SYMBOL_GPL(nfs4_fs_type); 338EXPORT_SYMBOL_GPL(nfs4_fs_type);
337 339
338static int __init register_nfs4_fs(void) 340static int __init register_nfs4_fs(void)
@@ -2717,6 +2719,5 @@ module_param(send_implementation_id, ushort, 0644);
2717MODULE_PARM_DESC(send_implementation_id, 2719MODULE_PARM_DESC(send_implementation_id,
2718 "Send implementation ID with NFSv4.1 exchange_id"); 2720 "Send implementation ID with NFSv4.1 exchange_id");
2719MODULE_PARM_DESC(nfs4_unique_id, "nfs_client_id4 uniquifier string"); 2721MODULE_PARM_DESC(nfs4_unique_id, "nfs_client_id4 uniquifier string");
2720MODULE_ALIAS("nfs4");
2721 2722
2722#endif /* CONFIG_NFS_V4 */ 2723#endif /* CONFIG_NFS_V4 */
diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c
index 13a21c8fca49..f33455b4d957 100644
--- a/fs/nfsd/nfsctl.c
+++ b/fs/nfsd/nfsctl.c
@@ -1090,6 +1090,7 @@ static struct file_system_type nfsd_fs_type = {
1090 .mount = nfsd_mount, 1090 .mount = nfsd_mount,
1091 .kill_sb = nfsd_umount, 1091 .kill_sb = nfsd_umount,
1092}; 1092};
1093MODULE_ALIAS_FS("nfsd");
1093 1094
1094#ifdef CONFIG_PROC_FS 1095#ifdef CONFIG_PROC_FS
1095static int create_proc_exports_entry(void) 1096static int create_proc_exports_entry(void)
diff --git a/fs/nilfs2/super.c b/fs/nilfs2/super.c
index 3c991dc84f2f..c7d1f9f18b09 100644
--- a/fs/nilfs2/super.c
+++ b/fs/nilfs2/super.c
@@ -1361,6 +1361,7 @@ struct file_system_type nilfs_fs_type = {
1361 .kill_sb = kill_block_super, 1361 .kill_sb = kill_block_super,
1362 .fs_flags = FS_REQUIRES_DEV, 1362 .fs_flags = FS_REQUIRES_DEV,
1363}; 1363};
1364MODULE_ALIAS_FS("nilfs2");
1364 1365
1365static void nilfs_inode_init_once(void *obj) 1366static void nilfs_inode_init_once(void *obj)
1366{ 1367{
diff --git a/fs/ntfs/super.c b/fs/ntfs/super.c
index 4a8289f8b16c..82650d52d916 100644
--- a/fs/ntfs/super.c
+++ b/fs/ntfs/super.c
@@ -3079,6 +3079,7 @@ static struct file_system_type ntfs_fs_type = {
3079 .kill_sb = kill_block_super, 3079 .kill_sb = kill_block_super,
3080 .fs_flags = FS_REQUIRES_DEV, 3080 .fs_flags = FS_REQUIRES_DEV,
3081}; 3081};
3082MODULE_ALIAS_FS("ntfs");
3082 3083
3083/* Stable names for the slab caches. */ 3084/* Stable names for the slab caches. */
3084static const char ntfs_index_ctx_cache_name[] = "ntfs_index_ctx_cache"; 3085static const char ntfs_index_ctx_cache_name[] = "ntfs_index_ctx_cache";
diff --git a/fs/ocfs2/dlmfs/dlmfs.c b/fs/ocfs2/dlmfs/dlmfs.c
index 4c5fc8d77dc2..12bafb7265ce 100644
--- a/fs/ocfs2/dlmfs/dlmfs.c
+++ b/fs/ocfs2/dlmfs/dlmfs.c
@@ -640,6 +640,7 @@ static struct file_system_type dlmfs_fs_type = {
640 .mount = dlmfs_mount, 640 .mount = dlmfs_mount,
641 .kill_sb = kill_litter_super, 641 .kill_sb = kill_litter_super,
642}; 642};
643MODULE_ALIAS_FS("ocfs2_dlmfs");
643 644
644static int __init init_dlmfs_fs(void) 645static int __init init_dlmfs_fs(void)
645{ 646{
diff --git a/fs/omfs/inode.c b/fs/omfs/inode.c
index 25d715c7c87a..d8b0afde2179 100644
--- a/fs/omfs/inode.c
+++ b/fs/omfs/inode.c
@@ -572,6 +572,7 @@ static struct file_system_type omfs_fs_type = {
572 .kill_sb = kill_block_super, 572 .kill_sb = kill_block_super,
573 .fs_flags = FS_REQUIRES_DEV, 573 .fs_flags = FS_REQUIRES_DEV,
574}; 574};
575MODULE_ALIAS_FS("omfs");
575 576
576static int __init init_omfs_fs(void) 577static int __init init_omfs_fs(void)
577{ 578{
diff --git a/fs/openpromfs/inode.c b/fs/openpromfs/inode.c
index ae47fa7efb9d..75885ffde44e 100644
--- a/fs/openpromfs/inode.c
+++ b/fs/openpromfs/inode.c
@@ -432,6 +432,7 @@ static struct file_system_type openprom_fs_type = {
432 .mount = openprom_mount, 432 .mount = openprom_mount,
433 .kill_sb = kill_anon_super, 433 .kill_sb = kill_anon_super,
434}; 434};
435MODULE_ALIAS_FS("openpromfs");
435 436
436static void op_inode_init_once(void *data) 437static void op_inode_init_once(void *data)
437{ 438{
diff --git a/fs/qnx4/inode.c b/fs/qnx4/inode.c
index 43098bb5723a..2e8caa62da78 100644
--- a/fs/qnx4/inode.c
+++ b/fs/qnx4/inode.c
@@ -412,6 +412,7 @@ static struct file_system_type qnx4_fs_type = {
412 .kill_sb = kill_block_super, 412 .kill_sb = kill_block_super,
413 .fs_flags = FS_REQUIRES_DEV, 413 .fs_flags = FS_REQUIRES_DEV,
414}; 414};
415MODULE_ALIAS_FS("qnx4");
415 416
416static int __init init_qnx4_fs(void) 417static int __init init_qnx4_fs(void)
417{ 418{
diff --git a/fs/qnx6/inode.c b/fs/qnx6/inode.c
index 57199a52a351..8d941edfefa1 100644
--- a/fs/qnx6/inode.c
+++ b/fs/qnx6/inode.c
@@ -672,6 +672,7 @@ static struct file_system_type qnx6_fs_type = {
672 .kill_sb = kill_block_super, 672 .kill_sb = kill_block_super,
673 .fs_flags = FS_REQUIRES_DEV, 673 .fs_flags = FS_REQUIRES_DEV,
674}; 674};
675MODULE_ALIAS_FS("qnx6");
675 676
676static int __init init_qnx6_fs(void) 677static int __init init_qnx6_fs(void)
677{ 678{
diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c
index 418bdc3a57da..194113b1b11b 100644
--- a/fs/reiserfs/super.c
+++ b/fs/reiserfs/super.c
@@ -2434,6 +2434,7 @@ struct file_system_type reiserfs_fs_type = {
2434 .kill_sb = reiserfs_kill_sb, 2434 .kill_sb = reiserfs_kill_sb,
2435 .fs_flags = FS_REQUIRES_DEV, 2435 .fs_flags = FS_REQUIRES_DEV,
2436}; 2436};
2437MODULE_ALIAS_FS("reiserfs");
2437 2438
2438MODULE_DESCRIPTION("ReiserFS journaled filesystem"); 2439MODULE_DESCRIPTION("ReiserFS journaled filesystem");
2439MODULE_AUTHOR("Hans Reiser <reiser@namesys.com>"); 2440MODULE_AUTHOR("Hans Reiser <reiser@namesys.com>");
diff --git a/fs/romfs/super.c b/fs/romfs/super.c
index 7e8d3a80bdab..15cbc41ee365 100644
--- a/fs/romfs/super.c
+++ b/fs/romfs/super.c
@@ -599,6 +599,7 @@ static struct file_system_type romfs_fs_type = {
599 .kill_sb = romfs_kill_sb, 599 .kill_sb = romfs_kill_sb,
600 .fs_flags = FS_REQUIRES_DEV, 600 .fs_flags = FS_REQUIRES_DEV,
601}; 601};
602MODULE_ALIAS_FS("romfs");
602 603
603/* 604/*
604 * inode storage initialiser 605 * inode storage initialiser
diff --git a/fs/sysv/super.c b/fs/sysv/super.c
index a38e87bdd78d..a39938b1feea 100644
--- a/fs/sysv/super.c
+++ b/fs/sysv/super.c
@@ -545,6 +545,7 @@ static struct file_system_type sysv_fs_type = {
545 .kill_sb = kill_block_super, 545 .kill_sb = kill_block_super,
546 .fs_flags = FS_REQUIRES_DEV, 546 .fs_flags = FS_REQUIRES_DEV,
547}; 547};
548MODULE_ALIAS_FS("sysv");
548 549
549static struct file_system_type v7_fs_type = { 550static struct file_system_type v7_fs_type = {
550 .owner = THIS_MODULE, 551 .owner = THIS_MODULE,
@@ -553,6 +554,7 @@ static struct file_system_type v7_fs_type = {
553 .kill_sb = kill_block_super, 554 .kill_sb = kill_block_super,
554 .fs_flags = FS_REQUIRES_DEV, 555 .fs_flags = FS_REQUIRES_DEV,
555}; 556};
557MODULE_ALIAS_FS("v7");
556 558
557static int __init init_sysv_fs(void) 559static int __init init_sysv_fs(void)
558{ 560{
@@ -586,5 +588,4 @@ static void __exit exit_sysv_fs(void)
586 588
587module_init(init_sysv_fs) 589module_init(init_sysv_fs)
588module_exit(exit_sysv_fs) 590module_exit(exit_sysv_fs)
589MODULE_ALIAS("v7");
590MODULE_LICENSE("GPL"); 591MODULE_LICENSE("GPL");
diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c
index ddc0f6ae65e9..ac838b844936 100644
--- a/fs/ubifs/super.c
+++ b/fs/ubifs/super.c
@@ -2174,6 +2174,7 @@ static struct file_system_type ubifs_fs_type = {
2174 .mount = ubifs_mount, 2174 .mount = ubifs_mount,
2175 .kill_sb = kill_ubifs_super, 2175 .kill_sb = kill_ubifs_super,
2176}; 2176};
2177MODULE_ALIAS_FS("ubifs");
2177 2178
2178/* 2179/*
2179 * Inode slab cache constructor. 2180 * Inode slab cache constructor.
diff --git a/fs/ufs/super.c b/fs/ufs/super.c
index dc8e3a861d0f..329f2f53b7ed 100644
--- a/fs/ufs/super.c
+++ b/fs/ufs/super.c
@@ -1500,6 +1500,7 @@ static struct file_system_type ufs_fs_type = {
1500 .kill_sb = kill_block_super, 1500 .kill_sb = kill_block_super,
1501 .fs_flags = FS_REQUIRES_DEV, 1501 .fs_flags = FS_REQUIRES_DEV,
1502}; 1502};
1503MODULE_ALIAS_FS("ufs");
1503 1504
1504static int __init init_ufs_fs(void) 1505static int __init init_ufs_fs(void)
1505{ 1506{
diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
index c407121873b4..ea341cea68cb 100644
--- a/fs/xfs/xfs_super.c
+++ b/fs/xfs/xfs_super.c
@@ -1561,6 +1561,7 @@ static struct file_system_type xfs_fs_type = {
1561 .kill_sb = kill_block_super, 1561 .kill_sb = kill_block_super,
1562 .fs_flags = FS_REQUIRES_DEV, 1562 .fs_flags = FS_REQUIRES_DEV,
1563}; 1563};
1564MODULE_ALIAS_FS("xfs");
1564 1565
1565STATIC int __init 1566STATIC int __init
1566xfs_init_zones(void) 1567xfs_init_zones(void)
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 74a907b8b950..2c28271ab9d4 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1825,6 +1825,8 @@ struct file_system_type {
1825 struct lock_class_key i_mutex_dir_key; 1825 struct lock_class_key i_mutex_dir_key;
1826}; 1826};
1827 1827
1828#define MODULE_ALIAS_FS(NAME) MODULE_ALIAS("fs-" NAME)
1829
1828extern struct dentry *mount_ns(struct file_system_type *fs_type, int flags, 1830extern struct dentry *mount_ns(struct file_system_type *fs_type, int flags,
1829 void *data, int (*fill_super)(struct super_block *, void *, int)); 1831 void *data, int (*fill_super)(struct super_block *, void *, int));
1830extern struct dentry *mount_bdev(struct file_system_type *fs_type, 1832extern struct dentry *mount_bdev(struct file_system_type *fs_type,
diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c
index 7b9b40224a27..a0f48a51e14e 100644
--- a/net/sunrpc/rpc_pipe.c
+++ b/net/sunrpc/rpc_pipe.c
@@ -1174,6 +1174,7 @@ static struct file_system_type rpc_pipe_fs_type = {
1174 .mount = rpc_mount, 1174 .mount = rpc_mount,
1175 .kill_sb = rpc_kill_sb, 1175 .kill_sb = rpc_kill_sb,
1176}; 1176};
1177MODULE_ALIAS_FS("rpc_pipefs");
1177 1178
1178static void 1179static void
1179init_once(void *foo) 1180init_once(void *foo)
@@ -1218,6 +1219,3 @@ void unregister_rpc_pipefs(void)
1218 kmem_cache_destroy(rpc_inode_cachep); 1219 kmem_cache_destroy(rpc_inode_cachep);
1219 unregister_filesystem(&rpc_pipe_fs_type); 1220 unregister_filesystem(&rpc_pipe_fs_type);
1220} 1221}
1221
1222/* Make 'mount -t rpc_pipefs ...' autoload this module. */
1223MODULE_ALIAS("rpc_pipefs");