]> www.infradead.org Git - users/willy/linux.git/commitdiff
vfs: Require specification of size of mount data for internal mounts
authorDavid Howells <dhowells@redhat.com>
Tue, 11 Sep 2018 21:20:53 +0000 (22:20 +0100)
committerDavid Howells <dhowells@redhat.com>
Tue, 11 Sep 2018 21:20:53 +0000 (22:20 +0100)
Require specification of the size of the mount data passed to the VFS
mounting functions by internal mounts.  The problem is that the legacy
handling for the upcoming mount-context patches has to copy an entire page
as that's how big the buffer is defined as being, but some of the internal
calls pass in a short bit of stack space, with the result that the stack
guard page may get hit.

Signed-off-by: David Howells <dhowells@redhat.com>
134 files changed:
arch/ia64/kernel/perfmon.c
arch/powerpc/platforms/cell/spufs/inode.c
arch/s390/hypfs/inode.c
arch/x86/kernel/cpu/intel_rdt_rdtgroup.c
drivers/base/devtmpfs.c
drivers/dax/super.c
drivers/gpu/drm/drm_drv.c
drivers/gpu/drm/i915/i915_gemfs.c
drivers/infiniband/hw/qib/qib_fs.c
drivers/misc/cxl/api.c
drivers/misc/ibmasm/ibmasmfs.c
drivers/mtd/mtdsuper.c
drivers/oprofile/oprofilefs.c
drivers/scsi/cxlflash/ocxl_hw.c
drivers/staging/erofs/super.c
drivers/usb/gadget/function/f_fs.c
drivers/usb/gadget/legacy/inode.c
drivers/virtio/virtio_balloon.c
drivers/xen/xenfs/super.c
fs/9p/vfs_super.c
fs/adfs/super.c
fs/affs/super.c
fs/afs/mntpt.c
fs/afs/super.c
fs/aio.c
fs/anon_inodes.c
fs/autofs/autofs_i.h
fs/autofs/init.c
fs/autofs/inode.c
fs/befs/linuxvfs.c
fs/bfs/inode.c
fs/binfmt_misc.c
fs/block_dev.c
fs/btrfs/super.c
fs/btrfs/tests/btrfs-tests.c
fs/ceph/super.c
fs/cifs/cifs_dfs_ref.c
fs/cifs/cifsfs.c
fs/coda/inode.c
fs/configfs/mount.c
fs/cramfs/inode.c
fs/debugfs/inode.c
fs/devpts/inode.c
fs/ecryptfs/main.c
fs/efivarfs/super.c
fs/efs/super.c
fs/exofs/super.c
fs/ext2/super.c
fs/ext4/super.c
fs/f2fs/super.c
fs/fat/inode.c
fs/fat/namei_msdos.c
fs/fat/namei_vfat.c
fs/freevxfs/vxfs_super.c
fs/fuse/control.c
fs/fuse/inode.c
fs/gfs2/ops_fstype.c
fs/gfs2/super.c
fs/hfs/super.c
fs/hfsplus/super.c
fs/hostfs/hostfs_kern.c
fs/hpfs/super.c
fs/hugetlbfs/inode.c
fs/internal.h
fs/isofs/inode.c
fs/jffs2/super.c
fs/jfs/super.c
fs/kernfs/mount.c
fs/libfs.c
fs/minix/inode.c
fs/namespace.c
fs/nfs/internal.h
fs/nfs/namespace.c
fs/nfs/nfs4namespace.c
fs/nfs/nfs4super.c
fs/nfs/super.c
fs/nfsd/nfsctl.c
fs/nilfs2/super.c
fs/nsfs.c
fs/ntfs/super.c
fs/ocfs2/dlmfs/dlmfs.c
fs/ocfs2/super.c
fs/omfs/inode.c
fs/openpromfs/inode.c
fs/orangefs/orangefs-kernel.h
fs/orangefs/super.c
fs/overlayfs/super.c
fs/pipe.c
fs/proc/inode.c
fs/proc/internal.h
fs/proc/root.c
fs/pstore/inode.c
fs/qnx4/inode.c
fs/qnx6/inode.c
fs/ramfs/inode.c
fs/reiserfs/super.c
fs/romfs/super.c
fs/squashfs/super.c
fs/super.c
fs/sysfs/mount.c
fs/sysv/inode.c
fs/sysv/super.c
fs/tracefs/inode.c
fs/ubifs/super.c
fs/udf/super.c
fs/ufs/super.c
fs/xfs/xfs_super.c
include/linux/debugfs.h
include/linux/fs.h
include/linux/lsm_hooks.h
include/linux/mount.h
include/linux/mtd/super.h
include/linux/ramfs.h
include/linux/security.h
include/linux/shmem_fs.h
init/do_mounts.c
ipc/mqueue.c
kernel/bpf/inode.c
kernel/cgroup/cgroup.c
kernel/cgroup/cpuset.c
kernel/trace/trace.c
mm/shmem.c
mm/zsmalloc.c
net/socket.c
net/sunrpc/rpc_pipe.c
security/apparmor/apparmorfs.c
security/apparmor/lsm.c
security/inode.c
security/security.c
security/selinux/hooks.c
security/selinux/selinuxfs.c
security/smack/smack_lsm.c
security/smack/smackfs.c
security/tomoyo/tomoyo.c

index 46bff16618362308ef016a2125cbdc6419c7124f..a9d4dc6c0427197d606acd5eb5a8638c3e8081f3 100644 (file)
@@ -611,7 +611,8 @@ pfm_unprotect_ctx_ctxsw(pfm_context_t *x, unsigned long f)
 static const struct dentry_operations pfmfs_dentry_operations;
 
 static struct dentry *
-pfmfs_mount(struct file_system_type *fs_type, int flags, const char *dev_name, void *data)
+pfmfs_mount(struct file_system_type *fs_type, int flags, const char *dev_name,
+           void *data, size_t data_size)
 {
        return mount_pseudo(fs_type, "pfm:", NULL, &pfmfs_dentry_operations,
                        PFMFS_MAGIC);
index db329d4bf1c30610836bedf072c49cc40edf0d00..90d55b47c471bc5455087e8a0e9d62d40c578171 100644 (file)
@@ -734,7 +734,7 @@ out:
 }
 
 static int
-spufs_fill_super(struct super_block *sb, void *data, int silent)
+spufs_fill_super(struct super_block *sb, void *data, size_t data_size, int silent)
 {
        struct spufs_sb_info *info;
        static const struct super_operations s_ops = {
@@ -761,9 +761,9 @@ spufs_fill_super(struct super_block *sb, void *data, int silent)
 
 static struct dentry *
 spufs_mount(struct file_system_type *fstype, int flags,
-               const char *name, void *data)
+               const char *name, void *data, size_t data_size)
 {
-       return mount_single(fstype, flags, data, spufs_fill_super);
+       return mount_single(fstype, flags, data, data_size, spufs_fill_super);
 }
 
 static struct file_system_type spufs_type = {
index c681329fdeec6ba42c95cb321b4ea8ae23b0df06..f75b38fd6cfaf795df5fff00b4bf3855db62f84b 100644 (file)
@@ -266,7 +266,8 @@ static int hypfs_show_options(struct seq_file *s, struct dentry *root)
        return 0;
 }
 
-static int hypfs_fill_super(struct super_block *sb, void *data, int silent)
+static int hypfs_fill_super(struct super_block *sb,
+                           void *data, size_t data_size, int silent)
 {
        struct inode *root_inode;
        struct dentry *root_dentry;
@@ -309,9 +310,9 @@ static int hypfs_fill_super(struct super_block *sb, void *data, int silent)
 }
 
 static struct dentry *hypfs_mount(struct file_system_type *fst, int flags,
-                       const char *devname, void *data)
+                       const char *devname, void *data, size_t data_size)
 {
-       return mount_single(fst, flags, data, hypfs_fill_super);
+       return mount_single(fst, flags, data, data_size, hypfs_fill_super);
 }
 
 static void hypfs_kill_super(struct super_block *sb)
index b799c00bef09a50f3b6127111bc269dbd075a99c..d6cb04c3a28b630737eb8378923c513929a71829 100644 (file)
@@ -1817,7 +1817,7 @@ static int mkdir_mondata_all(struct kernfs_node *parent_kn,
 
 static struct dentry *rdt_mount(struct file_system_type *fs_type,
                                int flags, const char *unused_dev_name,
-                               void *data)
+                               void *data, size_t data_size)
 {
        struct rdt_domain *dom;
        struct rdt_resource *r;
index f7768077e817b006235e3ab2602baec14b2fbaf7..9c0126ad7de13b2fac71cc1bd02272cbb106772f 100644 (file)
@@ -56,12 +56,12 @@ static int __init mount_param(char *str)
 __setup("devtmpfs.mount=", mount_param);
 
 static struct dentry *dev_mount(struct file_system_type *fs_type, int flags,
-                     const char *dev_name, void *data)
+                     const char *dev_name, void *data, size_t data_size)
 {
 #ifdef CONFIG_TMPFS
-       return mount_single(fs_type, flags, data, shmem_fill_super);
+       return mount_single(fs_type, flags, data, data_size, shmem_fill_super);
 #else
-       return mount_single(fs_type, flags, data, ramfs_fill_super);
+       return mount_single(fs_type, flags, data, data_size, ramfs_fill_super);
 #endif
 }
 
index 6e928f37d08429defdcecf71d1bf35c0ef5b613e..bc65ca34ec4b480435cc832f098d059e769cf761 100644 (file)
@@ -418,7 +418,7 @@ static const struct super_operations dax_sops = {
 };
 
 static struct dentry *dax_mount(struct file_system_type *fs_type,
-               int flags, const char *dev_name, void *data)
+               int flags, const char *dev_name, void *data, size_t data_size)
 {
        return mount_pseudo(fs_type, "dax:", &dax_sops, NULL, DAXFS_MAGIC);
 }
index ea4941da9b273f39fb81ab238eae769589f6a1c7..73f216e2d2606b33ecc6da8ffd8c7ef4521deb1c 100644 (file)
@@ -419,7 +419,8 @@ static const struct super_operations drm_fs_sops = {
 };
 
 static struct dentry *drm_fs_mount(struct file_system_type *fs_type, int flags,
-                                  const char *dev_name, void *data)
+                                  const char *dev_name,
+                                  void *data, size_t data_size)
 {
        return mount_pseudo(fs_type,
                            "drm:",
index 888b7d3f04c303412ce7de74d86f216a9434582d..bf0a355e8f460784af0b601e1c24b210c96fd75e 100644 (file)
@@ -57,7 +57,7 @@ int i915_gemfs_init(struct drm_i915_private *i915)
                int flags = 0;
                int err;
 
-               err = sb->s_op->remount_fs(sb, &flags, options);
+               err = sb->s_op->remount_fs(sb, &flags, options, sizeof(options));
                if (err) {
                        kern_unmount(gemfs);
                        return err;
index 1d940a2885c98fa93e17332572c86a3e73ece983..28648ef1f4ccaf8c476f4a3b8a92bac4f32105c7 100644 (file)
@@ -506,7 +506,8 @@ bail:
  * after device init.  The direct add_cntr_files() call handles adding
  * them from the init code, when the fs is already mounted.
  */
-static int qibfs_fill_super(struct super_block *sb, void *data, int silent)
+static int qibfs_fill_super(struct super_block *sb,
+                           void *data, size_t data_size, int silent)
 {
        struct qib_devdata *dd, *tmp;
        unsigned long flags;
@@ -541,11 +542,11 @@ bail:
 }
 
 static struct dentry *qibfs_mount(struct file_system_type *fs_type, int flags,
-                       const char *dev_name, void *data)
+                       const char *dev_name, void *data, size_t data_size)
 {
        struct dentry *ret;
 
-       ret = mount_single(fs_type, flags, data, qibfs_fill_super);
+       ret = mount_single(fs_type, flags, data, data_size, qibfs_fill_super);
        if (!IS_ERR(ret))
                qib_super = ret->d_sb;
        return ret;
index 750470ef2049b4ac4bef4ab73dcee30416a44331..84c05fd46d04d27e846387bbaaf3a97d6b5210e1 100644 (file)
@@ -42,7 +42,8 @@ static const struct dentry_operations cxl_fs_dops = {
 };
 
 static struct dentry *cxl_fs_mount(struct file_system_type *fs_type, int flags,
-                               const char *dev_name, void *data)
+                                  const char *dev_name,
+                                  void *data, size_t data_len)
 {
        return mount_pseudo(fs_type, "cxl:", NULL, &cxl_fs_dops,
                        CXL_PSEUDO_FS_MAGIC);
index fa840666bdd1aeb20cca67fc5df9556fc73135aa..381cca3bc87a2b5e264035336424626576a172da 100644 (file)
@@ -88,13 +88,15 @@ static LIST_HEAD(service_processors);
 
 static struct inode *ibmasmfs_make_inode(struct super_block *sb, int mode);
 static void ibmasmfs_create_files (struct super_block *sb);
-static int ibmasmfs_fill_super (struct super_block *sb, void *data, int silent);
+static int ibmasmfs_fill_super (struct super_block *sb, void *data, size_t data_size,
+                               int silent);
 
 
 static struct dentry *ibmasmfs_mount(struct file_system_type *fst,
-                       int flags, const char *name, void *data)
+                                    int flags, const char *name,
+                                    void *data, size_t data_size)
 {
-       return mount_single(fst, flags, data, ibmasmfs_fill_super);
+       return mount_single(fst, flags, data, data_size, ibmasmfs_fill_super);
 }
 
 static const struct super_operations ibmasmfs_s_ops = {
@@ -112,7 +114,8 @@ static struct file_system_type ibmasmfs_type = {
 };
 MODULE_ALIAS_FS("ibmasmfs");
 
-static int ibmasmfs_fill_super (struct super_block *sb, void *data, int silent)
+static int ibmasmfs_fill_super (struct super_block *sb,
+                               void *data, size_t data_size, int silent)
 {
        struct inode *root;
 
index d58a61c093047d80425e6b8c75083b57646a46b4..13706ea5cf507c07aa9668c88eaefd069cb43c46 100644 (file)
@@ -61,9 +61,9 @@ static int get_sb_mtd_set(struct super_block *sb, void *_mtd)
  * get a superblock on an MTD-backed filesystem
  */
 static struct dentry *mount_mtd_aux(struct file_system_type *fs_type, int flags,
-                         const char *dev_name, void *data,
+                         const char *dev_name, void *data, size_t data_size,
                          struct mtd_info *mtd,
-                         int (*fill_super)(struct super_block *, void *, int))
+                         int (*fill_super)(struct super_block *, void *, size_t, int))
 {
        struct super_block *sb;
        int ret;
@@ -79,7 +79,7 @@ static struct dentry *mount_mtd_aux(struct file_system_type *fs_type, int flags,
        pr_debug("MTDSB: New superblock for device %d (\"%s\")\n",
              mtd->index, mtd->name);
 
-       ret = fill_super(sb, data, flags & SB_SILENT ? 1 : 0);
+       ret = fill_super(sb, data, data_size, flags & SB_SILENT ? 1 : 0);
        if (ret < 0) {
                deactivate_locked_super(sb);
                return ERR_PTR(ret);
@@ -105,8 +105,10 @@ out_error:
  * get a superblock on an MTD-backed filesystem by MTD device number
  */
 static struct dentry *mount_mtd_nr(struct file_system_type *fs_type, int flags,
-                        const char *dev_name, void *data, int mtdnr,
-                        int (*fill_super)(struct super_block *, void *, int))
+                                  const char *dev_name,
+                                  void *data, size_t data_size, int mtdnr,
+                                  int (*fill_super)(struct super_block *, void *,
+                                                    size_t, int))
 {
        struct mtd_info *mtd;
 
@@ -116,15 +118,16 @@ static struct dentry *mount_mtd_nr(struct file_system_type *fs_type, int flags,
                return ERR_CAST(mtd);
        }
 
-       return mount_mtd_aux(fs_type, flags, dev_name, data, mtd, fill_super);
+       return mount_mtd_aux(fs_type, flags, dev_name, data, data_size, mtd,
+                            fill_super);
 }
 
 /*
  * set up an MTD-based superblock
  */
 struct dentry *mount_mtd(struct file_system_type *fs_type, int flags,
-              const char *dev_name, void *data,
-              int (*fill_super)(struct super_block *, void *, int))
+                        const char *dev_name, void *data, size_t data_size,
+                        int (*fill_super)(struct super_block *, void *, size_t, int))
 {
 #ifdef CONFIG_BLOCK
        struct block_device *bdev;
@@ -153,7 +156,7 @@ struct dentry *mount_mtd(struct file_system_type *fs_type, int flags,
                        if (!IS_ERR(mtd))
                                return mount_mtd_aux(
                                        fs_type, flags,
-                                       dev_name, data, mtd,
+                                       dev_name, data, data_size, mtd,
                                        fill_super);
 
                        printk(KERN_NOTICE "MTD:"
@@ -170,7 +173,7 @@ struct dentry *mount_mtd(struct file_system_type *fs_type, int flags,
                                pr_debug("MTDSB: mtd%%d, mtdnr %d\n",
                                      mtdnr);
                                return mount_mtd_nr(fs_type, flags,
-                                                    dev_name, data,
+                                                   dev_name, data, data_size,
                                                     mtdnr, fill_super);
                        }
                }
@@ -197,7 +200,8 @@ struct dentry *mount_mtd(struct file_system_type *fs_type, int flags,
        if (major != MTD_BLOCK_MAJOR)
                goto not_an_MTD_device;
 
-       return mount_mtd_nr(fs_type, flags, dev_name, data, mtdnr, fill_super);
+       return mount_mtd_nr(fs_type, flags, dev_name, data, data_size, mtdnr,
+                           fill_super);
 
 not_an_MTD_device:
 #endif /* CONFIG_BLOCK */
index 4ea08979312ca3e86804d5c7fa3e49be5969606a..c721d7fd7c7e845745d007ae0aa9cb0bc56036dc 100644 (file)
@@ -238,7 +238,8 @@ struct dentry *oprofilefs_mkdir(struct dentry *parent, char const *name)
 }
 
 
-static int oprofilefs_fill_super(struct super_block *sb, void *data, int silent)
+static int oprofilefs_fill_super(struct super_block *sb,
+                                void *data, size_t data_size, int silent)
 {
        struct inode *root_inode;
 
@@ -265,9 +266,10 @@ static int oprofilefs_fill_super(struct super_block *sb, void *data, int silent)
 
 
 static struct dentry *oprofilefs_mount(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data)
+       int flags, const char *dev_name, void *data, size_t data_size)
 {
-       return mount_single(fs_type, flags, data, oprofilefs_fill_super);
+       return mount_single(fs_type, flags, data, data_size,
+                           oprofilefs_fill_super);
 }
 
 
index 37b8dc60f5f6da21df27c7749aca73036cd2a235..1ca13e5e4ec2a64aabaee0135779de774e123cf4 100644 (file)
@@ -50,7 +50,7 @@ static const struct dentry_operations ocxlflash_fs_dops = {
  */
 static struct dentry *ocxlflash_fs_mount(struct file_system_type *fs_type,
                                         int flags, const char *dev_name,
-                                        void *data)
+                                        void *data, size_t data_size)
 {
        return mount_pseudo(fs_type, "ocxlflash:", NULL, &ocxlflash_fs_dops,
                            OCXLFLASH_FS_MAGIC);
index 1aec509c805feddf35b9db78e2db78bdcd5b00fd..ed52b1d2ef1b445809546efa2915db27aaada5cc 100644 (file)
@@ -480,7 +480,7 @@ struct erofs_mount_private {
 
 /* support mount_bdev() with options */
 static int erofs_fill_super(struct super_block *sb,
-       void *_priv, int silent)
+       void *_priv, size_t data_size, int silent)
 {
        struct erofs_mount_private *priv = _priv;
 
@@ -488,9 +488,9 @@ static int erofs_fill_super(struct super_block *sb,
                priv->options, silent);
 }
 
-static struct dentry *erofs_mount(
-       struct file_system_type *fs_type, int flags,
-       const char *dev_name, void *data)
+static struct dentry *erofs_mount(struct file_system_type *fs_type,
+                                 int flags, const char *dev_name,
+                                 void *data, size_t data_size)
 {
        struct erofs_mount_private priv = {
                .dev_name = dev_name,
@@ -498,7 +498,7 @@ static struct dentry *erofs_mount(
        };
 
        return mount_bdev(fs_type, flags, dev_name,
-               &priv, erofs_fill_super);
+               &priv, sizeof(priv), erofs_fill_super);
 }
 
 static void erofs_kill_sb(struct super_block *sb)
@@ -623,7 +623,8 @@ static int erofs_show_options(struct seq_file *seq, struct dentry *root)
        return 0;
 }
 
-static int erofs_remount(struct super_block *sb, int *flags, char *data)
+static int erofs_remount(struct super_block *sb, int *flags,
+                        char *data, size_t data_size)
 {
        BUG_ON(!sb_rdonly(sb));
 
index 3ada83d81bda8d2810ab04d154b65658f57e0ba2..b322a3d6ccd35125e26af08645f56440c642daac 100644 (file)
@@ -1376,7 +1376,8 @@ struct ffs_sb_fill_data {
        struct ffs_data *ffs_data;
 };
 
-static int ffs_sb_fill(struct super_block *sb, void *_data, int silent)
+static int ffs_sb_fill(struct super_block *sb, void *_data, size_t data_size,
+                      int silent)
 {
        struct ffs_sb_fill_data *data = _data;
        struct inode    *inode;
@@ -1504,7 +1505,7 @@ invalid:
 
 static struct dentry *
 ffs_fs_mount(struct file_system_type *t, int flags,
-             const char *dev_name, void *opts)
+            const char *dev_name, void *opts, size_t data_size)
 {
        struct ffs_sb_fill_data data = {
                .perms = {
@@ -1546,7 +1547,7 @@ ffs_fs_mount(struct file_system_type *t, int flags,
        ffs->private_data = ffs_dev;
        data.ffs_data = ffs;
 
-       rv = mount_nodev(t, flags, &data, ffs_sb_fill);
+       rv = mount_nodev(t, flags, &data, sizeof(data), ffs_sb_fill);
        if (IS_ERR(rv) && data.ffs_data) {
                ffs_release_dev(data.ffs_data);
                ffs_data_put(data.ffs_data);
index 37ca0e669bd85401c2337d75aa888ea5f9772d0d..286a982b43a3f583bbb8a8a19b18885beeeae025 100644 (file)
@@ -1990,7 +1990,8 @@ static const struct super_operations gadget_fs_operations = {
 };
 
 static int
-gadgetfs_fill_super (struct super_block *sb, void *opts, int silent)
+gadgetfs_fill_super (struct super_block *sb, void *opts, size_t data_size,
+                    int silent)
 {
        struct inode    *inode;
        struct dev_data *dev;
@@ -2046,9 +2047,9 @@ Enomem:
 /* "mount -t gadgetfs path /dev/gadget" ends up here */
 static struct dentry *
 gadgetfs_mount (struct file_system_type *t, int flags,
-               const char *path, void *opts)
+               const char *path, void *opts, size_t data_size)
 {
-       return mount_single (t, flags, opts, gadgetfs_fill_super);
+       return mount_single (t, flags, opts, data_size, gadgetfs_fill_super);
 }
 
 static void
index d1c1f6283729623d86ebea846a7e506653f997c0..461a26eba7e76028d45c9425693cb60c256a376d 100644 (file)
@@ -494,7 +494,7 @@ static int virtballoon_migratepage(struct balloon_dev_info *vb_dev_info,
 }
 
 static struct dentry *balloon_mount(struct file_system_type *fs_type,
-               int flags, const char *dev_name, void *data)
+               int flags, const char *dev_name, void *data, size_t data_size)
 {
        static const struct dentry_operations ops = {
                .d_dname = simple_dname,
index 71ddfb4cf61ccfef375a07d6271715e9478c68c6..fc4e6e43b66fe60f40e659c0352c4203c37070aa 100644 (file)
@@ -42,7 +42,8 @@ static const struct file_operations capabilities_file_ops = {
        .llseek = default_llseek,
 };
 
-static int xenfs_fill_super(struct super_block *sb, void *data, int silent)
+static int xenfs_fill_super(struct super_block *sb,
+                           void *data, size_t data_size, int silent)
 {
        static const struct tree_descr xenfs_files[] = {
                [2] = { "xenbus", &xen_xenbus_fops, S_IRUSR|S_IWUSR },
@@ -69,9 +70,9 @@ static int xenfs_fill_super(struct super_block *sb, void *data, int silent)
 
 static struct dentry *xenfs_mount(struct file_system_type *fs_type,
                                  int flags, const char *dev_name,
-                                 void *data)
+                                 void *data, size_t data_size)
 {
-       return mount_single(fs_type, flags, data, xenfs_fill_super);
+       return mount_single(fs_type, flags, data, data_size, xenfs_fill_super);
 }
 
 static struct file_system_type xenfs_type = {
index 48ce50484e80e280990dc822bf3e833025cbbc10..7def28abd3a55a6c368e7e4936d69a8daa777605 100644 (file)
@@ -116,7 +116,7 @@ v9fs_fill_super(struct super_block *sb, struct v9fs_session_info *v9ses,
  */
 
 static struct dentry *v9fs_mount(struct file_system_type *fs_type, int flags,
-                      const char *dev_name, void *data)
+                      const char *dev_name, void *data, size_t data_size)
 {
        struct super_block *sb = NULL;
        struct inode *inode = NULL;
index 7e099a7a4eb1e50bc9914e73432ecc751d0b21ed..d5e90b6d61aa2f1147738447790364a869ad8573 100644 (file)
@@ -210,7 +210,7 @@ static int parse_options(struct super_block *sb, char *options)
        return 0;
 }
 
-static int adfs_remount(struct super_block *sb, int *flags, char *data)
+static int adfs_remount(struct super_block *sb, int *flags, char *data, size_t data_size)
 {
        sync_filesystem(sb);
        *flags |= SB_NODIRATIME;
@@ -363,7 +363,8 @@ static inline unsigned long adfs_discsize(struct adfs_discrecord *dr, int block_
        return discsize;
 }
 
-static int adfs_fill_super(struct super_block *sb, void *data, int silent)
+static int adfs_fill_super(struct super_block *sb, void *data, size_t data_size,
+                          int silent)
 {
        struct adfs_discrecord *dr;
        struct buffer_head *bh;
@@ -523,9 +524,9 @@ error:
 }
 
 static struct dentry *adfs_mount(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data)
+       int flags, const char *dev_name, void *data, size_t data_size)
 {
-       return mount_bdev(fs_type, flags, dev_name, data, adfs_fill_super);
+       return mount_bdev(fs_type, flags, dev_name, data, data_size, adfs_fill_super);
 }
 
 static struct file_system_type adfs_fs_type = {
index d1ad11a8a4a59c2d7de3e854cfeb8b28716be59d..69dd5da6d88b1d10b1841403e86f4f03c61bff59 100644 (file)
@@ -26,7 +26,8 @@
 
 static int affs_statfs(struct dentry *dentry, struct kstatfs *buf);
 static int affs_show_options(struct seq_file *m, struct dentry *root);
-static int affs_remount (struct super_block *sb, int *flags, char *data);
+static int affs_remount (struct super_block *sb, int *flags,
+                        char *data, size_t data_size);
 
 static void
 affs_commit_super(struct super_block *sb, int wait)
@@ -335,7 +336,8 @@ static int affs_show_options(struct seq_file *m, struct dentry *root)
  * hopefully have the guts to do so. Until then: sorry for the mess.
  */
 
-static int affs_fill_super(struct super_block *sb, void *data, int silent)
+static int affs_fill_super(struct super_block *sb, void *data, size_t data_size,
+                          int silent)
 {
        struct affs_sb_info     *sbi;
        struct buffer_head      *root_bh = NULL;
@@ -550,7 +552,7 @@ got_root:
 }
 
 static int
-affs_remount(struct super_block *sb, int *flags, char *data)
+affs_remount(struct super_block *sb, int *flags, char *data, size_t data_size)
 {
        struct affs_sb_info     *sbi = AFFS_SB(sb);
        int                      blocksize;
@@ -633,9 +635,10 @@ affs_statfs(struct dentry *dentry, struct kstatfs *buf)
 }
 
 static struct dentry *affs_mount(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data)
+       int flags, const char *dev_name, void *data, size_t data_size)
 {
-       return mount_bdev(fs_type, flags, dev_name, data, affs_fill_super);
+       return mount_bdev(fs_type, flags, dev_name, data, data_size,
+                         affs_fill_super);
 }
 
 static void affs_kill_sb(struct super_block *sb)
index 99fd13500a97f9e77e2cbf603ae012bc460d1a2f..c45aa17765916417d2cb6e6f529c071771f779d3 100644 (file)
@@ -152,7 +152,8 @@ static struct vfsmount *afs_mntpt_do_automount(struct dentry *mntpt)
 
        /* try and do the mount */
        _debug("--- attempting mount %s -o %s ---", devname, options);
-       mnt = vfs_submount(mntpt, &afs_fs_type, devname, options);
+       mnt = vfs_submount(mntpt, &afs_fs_type, devname,
+                          options, strlen(options) + 1);
        _debug("--- mount result %p ---", mnt);
 
        free_page((unsigned long) devname);
index 4d3e274207fb7aa05aa320b957a03911984cf67d..b85f5e993539f04e7cb11c97efc003737da9bca2 100644 (file)
@@ -31,7 +31,8 @@
 
 static void afs_i_init_once(void *foo);
 static struct dentry *afs_mount(struct file_system_type *fs_type,
-                     int flags, const char *dev_name, void *data);
+                               int flags, const char *dev_name,
+                               void *data, size_t data_size);
 static void afs_kill_super(struct super_block *sb);
 static struct inode *afs_alloc_inode(struct super_block *sb);
 static void afs_destroy_inode(struct inode *inode);
@@ -490,7 +491,8 @@ static void afs_kill_super(struct super_block *sb)
  * get an AFS superblock
  */
 static struct dentry *afs_mount(struct file_system_type *fs_type,
-                               int flags, const char *dev_name, void *options)
+                               int flags, const char *dev_name,
+                               void *options, size_t data_size)
 {
        struct afs_mount_params params;
        struct super_block *sb;
index b9350f3360c698f7dfca64042447c3d942a4171e..e6181a8e762447fda6df9e860f9a8a73e59514d8 100644 (file)
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -233,7 +233,8 @@ static struct file *aio_private_file(struct kioctx *ctx, loff_t nr_pages)
 }
 
 static struct dentry *aio_mount(struct file_system_type *fs_type,
-                               int flags, const char *dev_name, void *data)
+                               int flags, const char *dev_name,
+                               void *data, size_t data_size)
 {
        struct dentry *root = mount_pseudo(fs_type, "aio:", NULL, NULL,
                                           AIO_RING_MAGIC);
index 91262c34b797c3932680640b3643fe360a643b97..bbeca44f8ddf0a17f4b424681d6a3c2723586b90 100644 (file)
@@ -39,7 +39,8 @@ static const struct dentry_operations anon_inodefs_dentry_operations = {
 };
 
 static struct dentry *anon_inodefs_mount(struct file_system_type *fs_type,
-                               int flags, const char *dev_name, void *data)
+                                        int flags, const char *dev_name,
+                                        void *data, size_t data_size)
 {
        return mount_pseudo(fs_type, "anon_inode:", NULL,
                        &anon_inodefs_dentry_operations, ANON_INODE_FS_MAGIC);
index 9f9cadbfbd7a34f8005fafb0960b3c60e4848c60..821494ab55545325dcae85d53515fdaf72da7e39 100644 (file)
@@ -198,7 +198,7 @@ static inline void managed_dentry_clear_managed(struct dentry *dentry)
 
 /* Initializing function */
 
-int autofs_fill_super(struct super_block *, void *, int);
+int autofs_fill_super(struct super_block *, void *, size_t, int);
 struct autofs_info *autofs_new_ino(struct autofs_sb_info *);
 void autofs_clean_ino(struct autofs_info *);
 
index 79ae07d9592f55cc06a10086cf45453250637d30..d0b80ff8afcb237a45e602aec9b673151d0b0148 100644 (file)
@@ -11,9 +11,9 @@
 #include "autofs_i.h"
 
 static struct dentry *autofs_mount(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data)
+       int flags, const char *dev_name, void *data, size_t data_size)
 {
-       return mount_nodev(fs_type, flags, data, autofs_fill_super);
+       return mount_nodev(fs_type, flags, data, data_size, autofs_fill_super);
 }
 
 static struct file_system_type autofs_fs_type = {
index 846c052569dd4913e1aea268ad88a0521251002e..93e014d7f8132df59833427f4cb74251c09bfd01 100644 (file)
@@ -201,7 +201,8 @@ static int parse_options(char *options, int *pipefd, kuid_t *uid, kgid_t *gid,
        return (*pipefd < 0);
 }
 
-int autofs_fill_super(struct super_block *s, void *data, int silent)
+int autofs_fill_super(struct super_block *s, void *data, size_t data_size,
+                     int silent)
 {
        struct inode *root_inode;
        struct dentry *root;
index 4700b45344397b26e385e38821217f9b861daee6..31f760ea2494f1eb5074867b9602b2fcf0d28194 100644 (file)
@@ -52,7 +52,7 @@ static int befs_utf2nls(struct super_block *sb, const char *in, int in_len,
 static int befs_nls2utf(struct super_block *sb, const char *in, int in_len,
                        char **out, int *out_len);
 static void befs_put_super(struct super_block *);
-static int befs_remount(struct super_block *, int *, char *);
+static int befs_remount(struct super_block *, int *, char *, size_t);
 static int befs_statfs(struct dentry *, struct kstatfs *);
 static int befs_show_options(struct seq_file *, struct dentry *);
 static int parse_options(char *, struct befs_mount_options *);
@@ -810,7 +810,7 @@ befs_put_super(struct super_block *sb)
  * Load a set of NLS translations if needed.
  */
 static int
-befs_fill_super(struct super_block *sb, void *data, int silent)
+befs_fill_super(struct super_block *sb, void *data, size_t data_size, int silent)
 {
        struct buffer_head *bh;
        struct befs_sb_info *befs_sb;
@@ -942,7 +942,7 @@ unacquire_none:
 }
 
 static int
-befs_remount(struct super_block *sb, int *flags, char *data)
+befs_remount(struct super_block *sb, int *flags, char *data, size_t data_size)
 {
        sync_filesystem(sb);
        if (!(*flags & SB_RDONLY))
@@ -976,9 +976,10 @@ befs_statfs(struct dentry *dentry, struct kstatfs *buf)
 
 static struct dentry *
 befs_mount(struct file_system_type *fs_type, int flags, const char *dev_name,
-           void *data)
+          void *data, size_t data_size)
 {
-       return mount_bdev(fs_type, flags, dev_name, data, befs_fill_super);
+       return mount_bdev(fs_type, flags, dev_name, data, data_size,
+                         befs_fill_super);
 }
 
 static struct file_system_type befs_fs_type = {
index 9a69392f1fb375c4c16b07332248edf7da57c9b6..6e76e4e762e8d02f6e8c053e05b9599274aa0ac1 100644 (file)
@@ -317,7 +317,8 @@ void bfs_dump_imap(const char *prefix, struct super_block *s)
 #endif
 }
 
-static int bfs_fill_super(struct super_block *s, void *data, int silent)
+static int bfs_fill_super(struct super_block *s, void *data, size_t data_size,
+                         int silent)
 {
        struct buffer_head *bh, *sbh;
        struct bfs_super_block *bfs_sb;
@@ -460,9 +461,10 @@ out:
 }
 
 static struct dentry *bfs_mount(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data)
+       int flags, const char *dev_name, void *data, size_t data_size)
 {
-       return mount_bdev(fs_type, flags, dev_name, data, bfs_fill_super);
+       return mount_bdev(fs_type, flags, dev_name, data, data_size,
+                         bfs_fill_super);
 }
 
 static struct file_system_type bfs_fs_type = {
index aa4a7a23ff99d8a9a111a37eee80d5e75cf0886b..757128ace6f98197cb31921690f28f0c087f429a 100644 (file)
@@ -820,7 +820,8 @@ static const struct super_operations s_ops = {
        .evict_inode    = bm_evict_inode,
 };
 
-static int bm_fill_super(struct super_block *sb, void *data, int silent)
+static int bm_fill_super(struct super_block *sb, void *data, size_t data_size,
+                        int silent)
 {
        int err;
        static const struct tree_descr bm_files[] = {
@@ -836,9 +837,9 @@ static int bm_fill_super(struct super_block *sb, void *data, int silent)
 }
 
 static struct dentry *bm_mount(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data)
+       int flags, const char *dev_name, void *data, size_t data_size)
 {
-       return mount_single(fs_type, flags, data, bm_fill_super);
+       return mount_single(fs_type, flags, data, data_size, bm_fill_super);
 }
 
 static struct linux_binfmt misc_format = {
index 38b8ce05cbc7e693d5d4b835eb586c586680ef0c..aebe41cd7d25f6c72a216029f150326c699ce015 100644 (file)
@@ -789,7 +789,7 @@ static const struct super_operations bdev_sops = {
 };
 
 static struct dentry *bd_mount(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data)
+       int flags, const char *dev_name, void *data, size_t data_size)
 {
        struct dentry *dent;
        dent = mount_pseudo(fs_type, "bdev:", &bdev_sops, NULL, BDEVFS_MAGIC);
index 6601c9aa5e3551cc7203ecdddc2593cbc2ec5e11..f8188b7822c5a8f4a752f800cc39336bc9436223 100644 (file)
@@ -61,7 +61,8 @@ static const struct super_operations btrfs_super_ops;
 static struct file_system_type btrfs_fs_type;
 static struct file_system_type btrfs_root_fs_type;
 
-static int btrfs_remount(struct super_block *sb, int *flags, char *data);
+static int btrfs_remount(struct super_block *sb, int *flags,
+                        char *data, size_t data_size);
 
 const char *btrfs_decode_error(int errno)
 {
@@ -1458,7 +1459,7 @@ out:
        return root;
 }
 
-static int parse_security_options(char *orig_opts,
+static int parse_security_options(char *orig_opts, size_t data_size,
                                  struct security_mnt_opts *sec_opts)
 {
        char *secdata = NULL;
@@ -1467,7 +1468,7 @@ static int parse_security_options(char *orig_opts,
        secdata = alloc_secdata();
        if (!secdata)
                return -ENOMEM;
-       ret = security_sb_copy_data(orig_opts, secdata);
+       ret = security_sb_copy_data(orig_opts, data_size, secdata);
        if (ret) {
                free_secdata(secdata);
                return ret;
@@ -1515,7 +1516,8 @@ static int setup_security_options(struct btrfs_fs_info *fs_info,
  *       for multiple device setup.  Make sure to keep it in sync.
  */
 static struct dentry *btrfs_mount_root(struct file_system_type *fs_type,
-               int flags, const char *device_name, void *data)
+                                      int flags, const char *device_name,
+                                      void *data, size_t data_size)
 {
        struct block_device *bdev = NULL;
        struct super_block *s;
@@ -1531,7 +1533,7 @@ static struct dentry *btrfs_mount_root(struct file_system_type *fs_type,
 
        security_init_mnt_opts(&new_sec_opts);
        if (data) {
-               error = parse_security_options(data, &new_sec_opts);
+               error = parse_security_options(data, data_size, &new_sec_opts);
                if (error)
                        return ERR_PTR(error);
        }
@@ -1647,7 +1649,7 @@ error_sec_opts:
  *      "btrfs subvolume set-default", mount_subvol() is called always.
  */
 static struct dentry *btrfs_mount(struct file_system_type *fs_type, int flags,
-               const char *device_name, void *data)
+               const char *device_name, void *data, size_t data_size)
 {
        struct vfsmount *mnt_root;
        struct dentry *root;
@@ -1667,21 +1669,24 @@ static struct dentry *btrfs_mount(struct file_system_type *fs_type, int flags,
        }
 
        /* mount device's root (/) */
-       mnt_root = vfs_kern_mount(&btrfs_root_fs_type, flags, device_name, data);
+       mnt_root = vfs_kern_mount(&btrfs_root_fs_type, flags, device_name,
+                                 data, data_size);
        if (PTR_ERR_OR_ZERO(mnt_root) == -EBUSY) {
                if (flags & SB_RDONLY) {
                        mnt_root = vfs_kern_mount(&btrfs_root_fs_type,
-                               flags & ~SB_RDONLY, device_name, data);
+                               flags & ~SB_RDONLY, device_name,
+                               data, data_size);
                } else {
                        mnt_root = vfs_kern_mount(&btrfs_root_fs_type,
-                               flags | SB_RDONLY, device_name, data);
+                               flags | SB_RDONLY, device_name,
+                               data, data_size);
                        if (IS_ERR(mnt_root)) {
                                root = ERR_CAST(mnt_root);
                                goto out;
                        }
 
                        down_write(&mnt_root->mnt_sb->s_umount);
-                       error = btrfs_remount(mnt_root->mnt_sb, &flags, NULL);
+                       error = btrfs_remount(mnt_root->mnt_sb, &flags, NULL, 0);
                        up_write(&mnt_root->mnt_sb->s_umount);
                        if (error < 0) {
                                root = ERR_PTR(error);
@@ -1763,7 +1768,8 @@ static inline void btrfs_remount_cleanup(struct btrfs_fs_info *fs_info,
        clear_bit(BTRFS_FS_STATE_REMOUNTING, &fs_info->fs_state);
 }
 
-static int btrfs_remount(struct super_block *sb, int *flags, char *data)
+static int btrfs_remount(struct super_block *sb, int *flags,
+                        char *data, size_t data_size)
 {
        struct btrfs_fs_info *fs_info = btrfs_sb(sb);
        struct btrfs_root *root = fs_info->tree_root;
@@ -1782,7 +1788,7 @@ static int btrfs_remount(struct super_block *sb, int *flags, char *data)
                struct security_mnt_opts new_sec_opts;
 
                security_init_mnt_opts(&new_sec_opts);
-               ret = parse_security_options(data, &new_sec_opts);
+               ret = parse_security_options(data, data_size, &new_sec_opts);
                if (ret)
                        goto restore;
                ret = setup_security_options(fs_info, sb,
index db72b3b6209e000e8d4a1a94507ed9185715dd28..6577914800f50c749a613329be81ffb93bada909 100644 (file)
@@ -24,7 +24,7 @@ static const struct super_operations btrfs_test_super_ops = {
 
 static struct dentry *btrfs_test_mount(struct file_system_type *fs_type,
                                       int flags, const char *dev_name,
-                                      void *data)
+                                      void *data, size_t data_size)
 {
        return mount_pseudo(fs_type, "btrfs_test:", &btrfs_test_super_ops,
                            NULL, BTRFS_TEST_MAGIC);
index eab1359d05532afb6960c7acfb5c4fee2891eac9..07dcc956dd321f2389ec1a6ce0d49e957b010fc6 100644 (file)
@@ -1025,7 +1025,8 @@ static int ceph_setup_bdi(struct super_block *sb, struct ceph_fs_client *fsc)
 }
 
 static struct dentry *ceph_mount(struct file_system_type *fs_type,
-                      int flags, const char *dev_name, void *data)
+                                int flags, const char *dev_name,
+                                void *data, size_t data_size)
 {
        struct super_block *sb;
        struct ceph_fs_client *fsc;
index 6b61df117fd48c456f30275053187ffd720d46e1..461d052a5d7374952e97762887668ba2911b3693 100644 (file)
@@ -260,7 +260,8 @@ static struct vfsmount *cifs_dfs_do_refmount(struct dentry *mntpt,
        if (IS_ERR(mountdata))
                return (struct vfsmount *)mountdata;
 
-       mnt = vfs_submount(mntpt, &cifs_fs_type, devname, mountdata);
+       mnt = vfs_submount(mntpt, &cifs_fs_type, devname,
+                          mountdata, strlen(mountdata) + 1);
        kfree(mountdata);
        kfree(devname);
        return mnt;
index 7065426b3280f95d495ec74df7c79b6b785b6688..9ebebe56ea1527270e7bf5ec420752dc634a461d 100644 (file)
@@ -595,7 +595,8 @@ static int cifs_show_stats(struct seq_file *s, struct dentry *root)
 }
 #endif
 
-static int cifs_remount(struct super_block *sb, int *flags, char *data)
+static int cifs_remount(struct super_block *sb, int *flags,
+                       char *data, size_t data_size)
 {
        sync_filesystem(sb);
        *flags |= SB_NODIRATIME;
@@ -698,7 +699,8 @@ static int cifs_set_super(struct super_block *sb, void *data)
 
 static struct dentry *
 cifs_smb3_do_mount(struct file_system_type *fs_type,
-             int flags, const char *dev_name, void *data, bool is_smb3)
+                  int flags, const char *dev_name, void *data, size_t data_size,
+                  bool is_smb3)
 {
        int rc;
        struct super_block *sb;
@@ -719,7 +721,7 @@ cifs_smb3_do_mount(struct file_system_type *fs_type,
                goto out_nls;
        }
 
-       cifs_sb->mountdata = kstrndup(data, PAGE_SIZE, GFP_KERNEL);
+       cifs_sb->mountdata = kstrndup(data, data_size, GFP_KERNEL);
        if (cifs_sb->mountdata == NULL) {
                root = ERR_PTR(-ENOMEM);
                goto out_free;
@@ -791,16 +793,18 @@ out_nls:
 
 static struct dentry *
 smb3_do_mount(struct file_system_type *fs_type,
-             int flags, const char *dev_name, void *data)
+             int flags, const char *dev_name, void *data, size_t data_size)
 {
-       return cifs_smb3_do_mount(fs_type, flags, dev_name, data, true);
+       return cifs_smb3_do_mount(fs_type, flags, dev_name, data, data_size,
+                                 true);
 }
 
 static struct dentry *
 cifs_do_mount(struct file_system_type *fs_type,
-             int flags, const char *dev_name, void *data)
+             int flags, const char *dev_name, void *data, size_t data_size)
 {
-       return cifs_smb3_do_mount(fs_type, flags, dev_name, data, false);
+       return cifs_smb3_do_mount(fs_type, flags, dev_name, data, data_size,
+                                 false);
 }
 
 static ssize_t
index 97424cf206c08af0519d74f82057180e5f8d6248..dd819c150f707e68647052ca9dc22ce58a766ef4 100644 (file)
@@ -93,7 +93,8 @@ void coda_destroy_inodecache(void)
        kmem_cache_destroy(coda_inode_cachep);
 }
 
-static int coda_remount(struct super_block *sb, int *flags, char *data)
+static int coda_remount(struct super_block *sb, int *flags,
+                       char *data, size_t data_size)
 {
        sync_filesystem(sb);
        *flags |= SB_NOATIME;
@@ -150,7 +151,8 @@ Ebadf:
        return -1;
 }
 
-static int coda_fill_super(struct super_block *sb, void *data, int silent)
+static int coda_fill_super(struct super_block *sb, void *data, size_t data_size,
+                          int silent)
 {
        struct inode *root = NULL;
        struct venus_comm *vc;
@@ -316,9 +318,10 @@ static int coda_statfs(struct dentry *dentry, struct kstatfs *buf)
 /* init_coda: used by filesystems.c to register coda */
 
 static struct dentry *coda_mount(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data)
+                                int flags, const char *dev_name,
+                                void *data, size_t data_size)
 {
-       return mount_nodev(fs_type, flags, data, coda_fill_super);
+       return mount_nodev(fs_type, flags, data, data_size, coda_fill_super);
 }
 
 struct file_system_type coda_fs_type = {
index cfd91320e869f5ba6053f7364707310a18e68318..c9c7c14eb9dbde8b8b8bd3c5b4baa2f97b16deb3 100644 (file)
@@ -66,7 +66,8 @@ static struct configfs_dirent configfs_root = {
        .s_iattr        = NULL,
 };
 
-static int configfs_fill_super(struct super_block *sb, void *data, int silent)
+static int configfs_fill_super(struct super_block *sb,
+                              void *data, size_t data_size, int silent)
 {
        struct inode *inode;
        struct dentry *root;
@@ -103,9 +104,9 @@ static int configfs_fill_super(struct super_block *sb, void *data, int silent)
 }
 
 static struct dentry *configfs_do_mount(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data)
+       int flags, const char *dev_name, void *data, size_t data_size)
 {
-       return mount_single(fs_type, flags, data, configfs_fill_super);
+       return mount_single(fs_type, flags, data, data_size, configfs_fill_super);
 }
 
 static struct file_system_type configfs_fs_type = {
index f408994fc632129dcbdceca43cedf2fd14705205..77d5cb62e76a36e007511134d8805d378d4ae9e5 100644 (file)
@@ -502,7 +502,8 @@ static void cramfs_kill_sb(struct super_block *sb)
        kfree(sbi);
 }
 
-static int cramfs_remount(struct super_block *sb, int *flags, char *data)
+static int cramfs_remount(struct super_block *sb, int *flags,
+                         char *data, size_t data_size)
 {
        sync_filesystem(sb);
        *flags |= SB_RDONLY;
@@ -603,7 +604,8 @@ static int cramfs_finalize_super(struct super_block *sb,
        return 0;
 }
 
-static int cramfs_blkdev_fill_super(struct super_block *sb, void *data,
+static int cramfs_blkdev_fill_super(struct super_block *sb,
+                                   void *data, size_t data_size,
                                    int silent)
 {
        struct cramfs_sb_info *sbi;
@@ -625,8 +627,8 @@ static int cramfs_blkdev_fill_super(struct super_block *sb, void *data,
        return cramfs_finalize_super(sb, &super.root);
 }
 
-static int cramfs_mtd_fill_super(struct super_block *sb, void *data,
-                                int silent)
+static int cramfs_mtd_fill_super(struct super_block *sb,
+                                void *data, size_t data_size, int silent)
 {
        struct cramfs_sb_info *sbi;
        struct cramfs_super super;
@@ -948,18 +950,19 @@ static const struct super_operations cramfs_ops = {
 };
 
 static struct dentry *cramfs_mount(struct file_system_type *fs_type, int flags,
-                                  const char *dev_name, void *data)
+                                  const char *dev_name,
+                                  void *data, size_t data_size)
 {
        struct dentry *ret = ERR_PTR(-ENOPROTOOPT);
 
        if (IS_ENABLED(CONFIG_CRAMFS_MTD)) {
-               ret = mount_mtd(fs_type, flags, dev_name, data,
+               ret = mount_mtd(fs_type, flags, dev_name, data, data_size,
                                cramfs_mtd_fill_super);
                if (!IS_ERR(ret))
                        return ret;
        }
        if (IS_ENABLED(CONFIG_CRAMFS_BLOCKDEV)) {
-               ret = mount_bdev(fs_type, flags, dev_name, data,
+               ret = mount_bdev(fs_type, flags, dev_name, data, data_size,
                                 cramfs_blkdev_fill_super);
        }
        return ret;
index 13b01351dd1cb3f8381dbddd2ee70717792b9ac7..57ba6d891c8539a99eb92643f4928e16c915540a 100644 (file)
@@ -130,7 +130,8 @@ static int debugfs_apply_options(struct super_block *sb)
        return 0;
 }
 
-static int debugfs_remount(struct super_block *sb, int *flags, char *data)
+static int debugfs_remount(struct super_block *sb, int *flags,
+                          char *data, size_t data_size)
 {
        int err;
        struct debugfs_fs_info *fsi = sb->s_fs_info;
@@ -190,7 +191,7 @@ static struct vfsmount *debugfs_automount(struct path *path)
 {
        debugfs_automount_t f;
        f = (debugfs_automount_t)path->dentry->d_fsdata;
-       return f(path->dentry, d_inode(path->dentry)->i_private);
+       return f(path->dentry, d_inode(path->dentry)->i_private, 0);
 }
 
 static const struct dentry_operations debugfs_dops = {
@@ -199,7 +200,8 @@ static const struct dentry_operations debugfs_dops = {
        .d_automount = debugfs_automount,
 };
 
-static int debug_fill_super(struct super_block *sb, void *data, int silent)
+static int debug_fill_super(struct super_block *sb,
+                           void *data, size_t data_size, int silent)
 {
        static const struct tree_descr debug_files[] = {{""}};
        struct debugfs_fs_info *fsi;
@@ -235,9 +237,9 @@ fail:
 
 static struct dentry *debug_mount(struct file_system_type *fs_type,
                        int flags, const char *dev_name,
-                       void *data)
+                       void *data, size_t data_size)
 {
-       return mount_single(fs_type, flags, data, debug_fill_super);
+       return mount_single(fs_type, flags, data, data_size, debug_fill_super);
 }
 
 static struct file_system_type debug_fs_type = {
@@ -539,7 +541,7 @@ EXPORT_SYMBOL_GPL(debugfs_create_dir);
 struct dentry *debugfs_create_automount(const char *name,
                                        struct dentry *parent,
                                        debugfs_automount_t f,
-                                       void *data)
+                                       void *data, size_t data_size)
 {
        struct dentry *dentry = start_creating(name, parent);
        struct inode *inode;
index c53814539070d5ac5d2196e2f4b7383055e11dd1..42165efb4d28c473cd7f8fce514bd09f098bf36a 100644 (file)
@@ -384,7 +384,8 @@ static void update_ptmx_mode(struct pts_fs_info *fsi)
        }
 }
 
-static int devpts_remount(struct super_block *sb, int *flags, char *data)
+static int devpts_remount(struct super_block *sb, int *flags,
+                         char *data, size_t data_size)
 {
        int err;
        struct pts_fs_info *fsi = DEVPTS_SB(sb);
@@ -445,7 +446,8 @@ static void *new_pts_fs_info(struct super_block *sb)
 }
 
 static int
-devpts_fill_super(struct super_block *s, void *data, int silent)
+devpts_fill_super(struct super_block *s, void *data, size_t data_size,
+                 int silent)
 {
        struct inode *inode;
        int error;
@@ -502,9 +504,9 @@ fail:
  *     instance are independent of the PTYs in other devpts instances.
  */
 static struct dentry *devpts_mount(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data)
+       int flags, const char *dev_name, void *data, size_t data_size)
 {
-       return mount_nodev(fs_type, flags, data, devpts_fill_super);
+       return mount_nodev(fs_type, flags, data, data_size, devpts_fill_super);
 }
 
 static void devpts_kill_sb(struct super_block *sb)
index 025d66a705db6bf41ba52ada490806780d101083..5d029b7e069af9c7338f60bc7854c5443ee8e1ae 100644 (file)
@@ -488,7 +488,7 @@ static struct file_system_type ecryptfs_fs_type;
  * @raw_data: The options passed into the kernel
  */
 static struct dentry *ecryptfs_mount(struct file_system_type *fs_type, int flags,
-                       const char *dev_name, void *raw_data)
+                       const char *dev_name, void *raw_data, size_t data_size)
 {
        struct super_block *s;
        struct ecryptfs_sb_info *sbi;
index 5b68e4294faa53728272e347fdf6002210fcb632..db0e417f1c7e6b37867c86172c5b692e322ea8ae 100644 (file)
@@ -191,7 +191,8 @@ static int efivarfs_destroy(struct efivar_entry *entry, void *data)
        return 0;
 }
 
-static int efivarfs_fill_super(struct super_block *sb, void *data, int silent)
+static int efivarfs_fill_super(struct super_block *sb,
+                              void *data, size_t data_size, int silent)
 {
        struct inode *inode = NULL;
        struct dentry *root;
@@ -227,9 +228,11 @@ static int efivarfs_fill_super(struct super_block *sb, void *data, int silent)
 }
 
 static struct dentry *efivarfs_mount(struct file_system_type *fs_type,
-                                   int flags, const char *dev_name, void *data)
+                                    int flags, const char *dev_name,
+                                    void *data, size_t data_size)
 {
-       return mount_single(fs_type, flags, data, efivarfs_fill_super);
+       return mount_single(fs_type, flags, data, data_size,
+                           efivarfs_fill_super);
 }
 
 static void efivarfs_kill_sb(struct super_block *sb)
index 6ffb7ba1547a66508d3179fe3dab86362f70419d..ce85f22651f3d9c33fc37c109400877738759441 100644 (file)
 #include <linux/efs_fs_sb.h>
 
 static int efs_statfs(struct dentry *dentry, struct kstatfs *buf);
-static int efs_fill_super(struct super_block *s, void *d, int silent);
+static int efs_fill_super(struct super_block *s, void *d, size_t data_size,
+                         int silent);
 
 static struct dentry *efs_mount(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data)
+       int flags, const char *dev_name, void *data, size_t data_size)
 {
-       return mount_bdev(fs_type, flags, dev_name, data, efs_fill_super);
+       return mount_bdev(fs_type, flags, dev_name, data, data_size,
+                         efs_fill_super);
 }
 
 static void efs_kill_sb(struct super_block *s)
@@ -113,7 +115,8 @@ static void destroy_inodecache(void)
        kmem_cache_destroy(efs_inode_cachep);
 }
 
-static int efs_remount(struct super_block *sb, int *flags, char *data)
+static int efs_remount(struct super_block *sb, int *flags,
+                      char *data, size_t data_size)
 {
        sync_filesystem(sb);
        *flags |= SB_RDONLY;
@@ -253,7 +256,8 @@ static int efs_validate_super(struct efs_sb_info *sb, struct efs_super *super) {
        return 0;    
 }
 
-static int efs_fill_super(struct super_block *s, void *d, int silent)
+static int efs_fill_super(struct super_block *s, void *d, size_t data_size,
+                         int silent)
 {
        struct efs_sb_info *sb;
        struct buffer_head *bh;
index 41cf2fbee50da4cb9ec0999a967d7d777fb7fc45..a5f94b7e7b5bdb435032c2954e5b96fb1f41ae08 100644 (file)
@@ -704,7 +704,8 @@ out:
 /*
  * Read the superblock from the OSD and fill in the fields
  */
-static int exofs_fill_super(struct super_block *sb, void *data, int silent)
+static int exofs_fill_super(struct super_block *sb, void *data, size_t data_size,
+                           int silent)
 {
        struct inode *root;
        struct exofs_mountopt *opts = data;
@@ -860,7 +861,7 @@ free_sbi:
  */
 static struct dentry *exofs_mount(struct file_system_type *type,
                          int flags, const char *dev_name,
-                         void *data)
+                         void *data, size_t data_size)
 {
        struct exofs_mountopt opts;
        int ret;
@@ -871,7 +872,7 @@ static struct dentry *exofs_mount(struct file_system_type *type,
 
        if (!opts.dev_name)
                opts.dev_name = dev_name;
-       return mount_nodev(type, flags, &opts, exofs_fill_super);
+       return mount_nodev(type, flags, &opts, 0, exofs_fill_super);
 }
 
 /*
index 73bd58fa13de40e8c010bfcd0fb96764ab792f79..7201d6e7e030e97ba5a256576e19a3aa13af08ca 100644 (file)
@@ -39,7 +39,8 @@
 #include "acl.h"
 
 static void ext2_write_super(struct super_block *sb);
-static int ext2_remount (struct super_block * sb, int * flags, char * data);
+static int ext2_remount (struct super_block * sb, int * flags,
+                        char * data, size_t data_size);
 static int ext2_statfs (struct dentry * dentry, struct kstatfs * buf);
 static int ext2_sync_fs(struct super_block *sb, int wait);
 static int ext2_freeze(struct super_block *sb);
@@ -819,7 +820,8 @@ static unsigned long descriptor_loc(struct super_block *sb,
        return ext2_group_first_block_no(sb, bg) + has_super;
 }
 
-static int ext2_fill_super(struct super_block *sb, void *data, int silent)
+static int ext2_fill_super(struct super_block *sb, void *data, size_t data_size,
+                          int silent)
 {
        struct dax_device *dax_dev = fs_dax_get_by_bdev(sb->s_bdev);
        struct buffer_head * bh;
@@ -1324,7 +1326,8 @@ static void ext2_write_super(struct super_block *sb)
                ext2_sync_fs(sb, 1);
 }
 
-static int ext2_remount (struct super_block * sb, int * flags, char * data)
+static int ext2_remount (struct super_block * sb, int * flags,
+                        char *data, size_t data_size)
 {
        struct ext2_sb_info * sbi = EXT2_SB(sb);
        struct ext2_super_block * es;
@@ -1475,9 +1478,10 @@ static int ext2_statfs (struct dentry * dentry, struct kstatfs * buf)
 }
 
 static struct dentry *ext2_mount(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data)
+       int flags, const char *dev_name, void *data, size_t data_size)
 {
-       return mount_bdev(fs_type, flags, dev_name, data, ext2_fill_super);
+       return mount_bdev(fs_type, flags, dev_name, data, data_size,
+                         ext2_fill_super);
 }
 
 #ifdef CONFIG_QUOTA
index 5863fd22e90bb20c102274f3e320637858bdef87..dc890be30fd94d1b00ff8522e06e67a97d872d60 100644 (file)
@@ -70,12 +70,13 @@ static void ext4_mark_recovery_complete(struct super_block *sb,
 static void ext4_clear_journal_err(struct super_block *sb,
                                   struct ext4_super_block *es);
 static int ext4_sync_fs(struct super_block *sb, int wait);
-static int ext4_remount(struct super_block *sb, int *flags, char *data);
+static int ext4_remount(struct super_block *sb, int *flags,
+                       char *data, size_t data_size);
 static int ext4_statfs(struct dentry *dentry, struct kstatfs *buf);
 static int ext4_unfreeze(struct super_block *sb);
 static int ext4_freeze(struct super_block *sb);
 static struct dentry *ext4_mount(struct file_system_type *fs_type, int flags,
-                      const char *dev_name, void *data);
+                      const char *dev_name, void *data, size_t data_size);
 static inline int ext2_feature_set_ok(struct super_block *sb);
 static inline int ext3_feature_set_ok(struct super_block *sb);
 static int ext4_feature_set_ok(struct super_block *sb, int readonly);
@@ -3489,7 +3490,8 @@ static void ext4_set_resv_clusters(struct super_block *sb)
        atomic64_set(&sbi->s_resv_clusters, resv_clusters);
 }
 
-static int ext4_fill_super(struct super_block *sb, void *data, int silent)
+static int ext4_fill_super(struct super_block *sb, void *data, size_t data_size,
+                          int silent)
 {
        struct dax_device *dax_dev = fs_dax_get_by_bdev(sb->s_bdev);
        char *orig_data = kstrdup(data, GFP_KERNEL);
@@ -5087,7 +5089,8 @@ struct ext4_mount_options {
 #endif
 };
 
-static int ext4_remount(struct super_block *sb, int *flags, char *data)
+static int ext4_remount(struct super_block *sb, int *flags,
+                       char *data, size_t data_size)
 {
        struct ext4_super_block *es;
        struct ext4_sb_info *sbi = EXT4_SB(sb);
@@ -5859,9 +5862,10 @@ static int ext4_get_next_id(struct super_block *sb, struct kqid *qid)
 #endif
 
 static struct dentry *ext4_mount(struct file_system_type *fs_type, int flags,
-                      const char *dev_name, void *data)
+                      const char *dev_name, void *data, size_t data_size)
 {
-       return mount_bdev(fs_type, flags, dev_name, data, ext4_fill_super);
+       return mount_bdev(fs_type, flags, dev_name, data, data_size,
+                         ext4_fill_super);
 }
 
 #if !defined(CONFIG_EXT2_FS) && !defined(CONFIG_EXT2_FS_MODULE) && defined(CONFIG_EXT4_USE_FOR_EXT2)
index 896b885f504e782f2bc37a4aba4da5e9870f2b20..2b110139420ce6209a3f3e3b9eedd6daf9d05ea4 100644 (file)
@@ -1419,7 +1419,8 @@ static void default_options(struct f2fs_sb_info *sbi)
 #ifdef CONFIG_QUOTA
 static int f2fs_enable_quotas(struct super_block *sb);
 #endif
-static int f2fs_remount(struct super_block *sb, int *flags, char *data)
+static int f2fs_remount(struct super_block *sb, int *flags,
+                       char *data, size_t data_size)
 {
        struct f2fs_sb_info *sbi = F2FS_SB(sb);
        struct f2fs_mount_info org_mount_opt;
@@ -2727,7 +2728,8 @@ static void f2fs_tuning_parameters(struct f2fs_sb_info *sbi)
        sbi->readdir_ra = 1;
 }
 
-static int f2fs_fill_super(struct super_block *sb, void *data, int silent)
+static int f2fs_fill_super(struct super_block *sb, void *data, size_t data_size,
+                          int silent)
 {
        struct f2fs_sb_info *sbi;
        struct f2fs_super_block *raw_super;
@@ -3154,9 +3156,10 @@ free_sbi:
 }
 
 static struct dentry *f2fs_mount(struct file_system_type *fs_type, int flags,
-                       const char *dev_name, void *data)
+                       const char *dev_name, void *data, size_t data_size)
 {
-       return mount_bdev(fs_type, flags, dev_name, data, f2fs_fill_super);
+       return mount_bdev(fs_type, flags, dev_name, data, data_size,
+                         f2fs_fill_super);
 }
 
 static void kill_f2fs_super(struct super_block *sb)
index d6b81e31f9f5d827be92ffad4cf240fa32e5f767..179a5cf523d7e85273ee7bf0a2c03241a99cacc4 100644 (file)
@@ -792,7 +792,8 @@ static void __exit fat_destroy_inodecache(void)
        kmem_cache_destroy(fat_inode_cachep);
 }
 
-static int fat_remount(struct super_block *sb, int *flags, char *data)
+static int fat_remount(struct super_block *sb, int *flags,
+                      char *data, size_t data_size)
 {
        bool new_rdonly;
        struct msdos_sb_info *sbi = MSDOS_SB(sb);
index efb8c40c9d27467d0d58d10dd5b1ba313c06d9d6..8c49575b4da8d6ce87421e866b561c7ac201df29 100644 (file)
@@ -646,16 +646,18 @@ static void setup(struct super_block *sb)
        sb->s_flags |= SB_NOATIME;
 }
 
-static int msdos_fill_super(struct super_block *sb, void *data, int silent)
+static int msdos_fill_super(struct super_block *sb, void *data, size_t data_size,
+                           int silent)
 {
        return fat_fill_super(sb, data, silent, 0, setup);
 }
 
 static struct dentry *msdos_mount(struct file_system_type *fs_type,
                        int flags, const char *dev_name,
-                       void *data)
+                       void *data, size_t data_size)
 {
-       return mount_bdev(fs_type, flags, dev_name, data, msdos_fill_super);
+       return mount_bdev(fs_type, flags, dev_name, data, data_size,
+                         msdos_fill_super);
 }
 
 static struct file_system_type msdos_fs_type = {
index 82cd1e69cbdf283322e8d7fa8566a22cca54fc0a..993f186705b12d533d24148e2b6390d5f2ee6cd7 100644 (file)
@@ -1043,16 +1043,18 @@ static void setup(struct super_block *sb)
                sb->s_d_op = &vfat_dentry_ops;
 }
 
-static int vfat_fill_super(struct super_block *sb, void *data, int silent)
+static int vfat_fill_super(struct super_block *sb, void *data, size_t data_size,
+                          int silent)
 {
        return fat_fill_super(sb, data, silent, 1, setup);
 }
 
 static struct dentry *vfat_mount(struct file_system_type *fs_type,
                       int flags, const char *dev_name,
-                      void *data)
+                      void *data, size_t data_size)
 {
-       return mount_bdev(fs_type, flags, dev_name, data, vfat_fill_super);
+       return mount_bdev(fs_type, flags, dev_name, data, data_size,
+                         vfat_fill_super);
 }
 
 static struct file_system_type vfat_fs_type = {
index 48b24bb50d020e73733ea556c133de1f4611144e..1c6cf91f6de947a05f89d4dec965397eba8b52b4 100644 (file)
@@ -113,7 +113,8 @@ vxfs_statfs(struct dentry *dentry, struct kstatfs *bufp)
        return 0;
 }
 
-static int vxfs_remount(struct super_block *sb, int *flags, char *data)
+static int vxfs_remount(struct super_block *sb, int *flags,
+                       char *data, size_t data_size)
 {
        sync_filesystem(sb);
        *flags |= SB_RDONLY;
@@ -199,6 +200,7 @@ static int vxfs_try_sb_magic(struct super_block *sbp, int silent,
  * vxfs_read_super - read superblock into memory and initialize filesystem
  * @sbp:               VFS superblock (to fill)
  * @dp:                        fs private mount data
+ * @data_size:         size of mount data
  * @silent:            do not complain loudly when sth is wrong
  *
  * Description:
@@ -211,7 +213,8 @@ static int vxfs_try_sb_magic(struct super_block *sbp, int silent,
  * Locking:
  *   We are under @sbp->s_lock.
  */
-static int vxfs_fill_super(struct super_block *sbp, void *dp, int silent)
+static int vxfs_fill_super(struct super_block *sbp, void *dp, size_t data_size,
+                          int silent)
 {
        struct vxfs_sb_info     *infp;
        struct vxfs_sb          *rsbp;
@@ -312,9 +315,10 @@ out:
  * The usual module blurb.
  */
 static struct dentry *vxfs_mount(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data)
+       int flags, const char *dev_name, void *data, size_t data_size)
 {
-       return mount_bdev(fs_type, flags, dev_name, data, vxfs_fill_super);
+       return mount_bdev(fs_type, flags, dev_name, data, data_size,
+                         vxfs_fill_super);
 }
 
 static struct file_system_type vxfs_fs_type = {
index 0b694655d988073d1bf33f5e2c2859260ac6be00..e09b9cd9c3fcb6efac67814ea037abf435bfbf5c 100644 (file)
@@ -297,7 +297,8 @@ void fuse_ctl_remove_conn(struct fuse_conn *fc)
        drop_nlink(d_inode(fuse_control_sb->s_root));
 }
 
-static int fuse_ctl_fill_super(struct super_block *sb, void *data, int silent)
+static int fuse_ctl_fill_super(struct super_block *sb,
+                              void *data, size_t data_size, int silent)
 {
        static const struct tree_descr empty_descr = {""};
        struct fuse_conn *fc;
@@ -324,9 +325,11 @@ static int fuse_ctl_fill_super(struct super_block *sb, void *data, int silent)
 }
 
 static struct dentry *fuse_ctl_mount(struct file_system_type *fs_type,
-                       int flags, const char *dev_name, void *raw_data)
+                                    int flags, const char *dev_name,
+                                    void *raw_data, size_t data_size)
 {
-       return mount_single(fs_type, flags, raw_data, fuse_ctl_fill_super);
+       return mount_single(fs_type, flags, raw_data, data_size,
+                           fuse_ctl_fill_super);
 }
 
 static void fuse_ctl_kill_sb(struct super_block *sb)
index db9e60b7eb691bc4f0814c694577f60d363f32a1..9db8c0c745a9b94ef4c75879eec1712b3d36ea06 100644 (file)
@@ -138,7 +138,8 @@ static void fuse_evict_inode(struct inode *inode)
        }
 }
 
-static int fuse_remount_fs(struct super_block *sb, int *flags, char *data)
+static int fuse_remount_fs(struct super_block *sb, int *flags,
+                          char *data, size_t data_size)
 {
        sync_filesystem(sb);
        if (*flags & SB_MANDLOCK)
@@ -1052,7 +1053,8 @@ void fuse_dev_free(struct fuse_dev *fud)
 }
 EXPORT_SYMBOL_GPL(fuse_dev_free);
 
-static int fuse_fill_super(struct super_block *sb, void *data, int silent)
+static int fuse_fill_super(struct super_block *sb, void *data, size_t data_size,
+                          int silent)
 {
        struct fuse_dev *fud;
        struct fuse_conn *fc;
@@ -1208,9 +1210,10 @@ static int fuse_fill_super(struct super_block *sb, void *data, int silent)
 
 static struct dentry *fuse_mount(struct file_system_type *fs_type,
                       int flags, const char *dev_name,
-                      void *raw_data)
+                      void *raw_data, size_t data_size)
 {
-       return mount_nodev(fs_type, flags, raw_data, fuse_fill_super);
+       return mount_nodev(fs_type, flags, raw_data, data_size,
+                          fuse_fill_super);
 }
 
 static void fuse_sb_destroy(struct super_block *sb)
@@ -1247,9 +1250,10 @@ MODULE_ALIAS_FS("fuse");
 #ifdef CONFIG_BLOCK
 static struct dentry *fuse_mount_blk(struct file_system_type *fs_type,
                           int flags, const char *dev_name,
-                          void *raw_data)
+                          void *raw_data, size_t data_size)
 {
-       return mount_bdev(fs_type, flags, dev_name, raw_data, fuse_fill_super);
+       return mount_bdev(fs_type, flags, dev_name, raw_data, data_size,
+                         fuse_fill_super);
 }
 
 static void fuse_kill_sb_blk(struct super_block *sb)
index c2469833b4fba92d8d1be90b3637379b904920a7..f757b5dfc960a9dbc4ebfd0ee2b8aceb27345c7a 100644 (file)
@@ -1220,6 +1220,7 @@ static int test_gfs2_super(struct super_block *s, void *ptr)
  * @flags: Mount flags
  * @dev_name: The name of the device
  * @data: The mount arguments
+ * @data_size: The size of the mount arguments
  *
  * Q. Why not use get_sb_bdev() ?
  * A. We need to select one of two root directories to mount, independent
@@ -1229,7 +1230,7 @@ static int test_gfs2_super(struct super_block *s, void *ptr)
  */
 
 static struct dentry *gfs2_mount(struct file_system_type *fs_type, int flags,
-                      const char *dev_name, void *data)
+                      const char *dev_name, void *data, size_t data_size)
 {
        struct block_device *bdev;
        struct super_block *s;
@@ -1326,7 +1327,8 @@ static int set_meta_super(struct super_block *s, void *ptr)
 }
 
 static struct dentry *gfs2_mount_meta(struct file_system_type *fs_type,
-                       int flags, const char *dev_name, void *data)
+                                     int flags, const char *dev_name,
+                                     void *data, size_t data_size)
 {
        struct super_block *s;
        struct gfs2_sbd *sdp;
index c212893534ed61f48e29bae9ebdb933127f34558..da62f0fad3c0124b0782628a2c1ec42c5365c249 100644 (file)
@@ -1228,11 +1228,13 @@ static int gfs2_statfs(struct dentry *dentry, struct kstatfs *buf)
  * @sb:  the filesystem
  * @flags:  the remount flags
  * @data:  extra data passed in (not used right now)
+ * @data_size: size of the extra data
  *
  * Returns: errno
  */
 
-static int gfs2_remount_fs(struct super_block *sb, int *flags, char *data)
+static int gfs2_remount_fs(struct super_block *sb, int *flags,
+                          char *data, size_t data_size)
 {
        struct gfs2_sbd *sdp = sb->s_fs_info;
        struct gfs2_args args = sdp->sd_args; /* Default to current settings */
index 173876782f73fd33838bec0e5508cbe79fa5c868..e739b381b041b2d50f11c5b7c1c0aa71f5cd8702 100644 (file)
@@ -111,7 +111,8 @@ static int hfs_statfs(struct dentry *dentry, struct kstatfs *buf)
        return 0;
 }
 
-static int hfs_remount(struct super_block *sb, int *flags, char *data)
+static int hfs_remount(struct super_block *sb, int *flags,
+                      char *data, size_t data_size)
 {
        sync_filesystem(sb);
        *flags |= SB_NODIRATIME;
@@ -382,7 +383,8 @@ static int parse_options(char *options, struct hfs_sb_info *hsb)
  * hfs_btree_init() to get the necessary data about the extents and
  * catalog B-trees and, finally, reading the root inode into memory.
  */
-static int hfs_fill_super(struct super_block *sb, void *data, int silent)
+static int hfs_fill_super(struct super_block *sb, void *data, size_t data_size,
+                         int silent)
 {
        struct hfs_sb_info *sbi;
        struct hfs_find_data fd;
@@ -458,9 +460,11 @@ bail:
 }
 
 static struct dentry *hfs_mount(struct file_system_type *fs_type,
-                     int flags, const char *dev_name, void *data)
+                               int flags, const char *dev_name,
+                               void *data, size_t data_size)
 {
-       return mount_bdev(fs_type, flags, dev_name, data, hfs_fill_super);
+       return mount_bdev(fs_type, flags, dev_name, data, data_size,
+                         hfs_fill_super);
 }
 
 static struct file_system_type hfs_fs_type = {
index eb4535eba95d9a5e13dfda5fb196849a069bda64..e12e051d46b49e93f03ff9b95d95260058e14695 100644 (file)
@@ -326,7 +326,8 @@ static int hfsplus_statfs(struct dentry *dentry, struct kstatfs *buf)
        return 0;
 }
 
-static int hfsplus_remount(struct super_block *sb, int *flags, char *data)
+static int hfsplus_remount(struct super_block *sb, int *flags,
+                          char *data, size_t data_size)
 {
        sync_filesystem(sb);
        if ((bool)(*flags & SB_RDONLY) == sb_rdonly(sb))
@@ -371,7 +372,8 @@ static const struct super_operations hfsplus_sops = {
        .show_options   = hfsplus_show_options,
 };
 
-static int hfsplus_fill_super(struct super_block *sb, void *data, int silent)
+static int hfsplus_fill_super(struct super_block *sb,
+                             void *data, size_t data_size, int silent)
 {
        struct hfsplus_vh *vhdr;
        struct hfsplus_sb_info *sbi;
@@ -643,9 +645,11 @@ static void hfsplus_destroy_inode(struct inode *inode)
 #define HFSPLUS_INODE_SIZE     sizeof(struct hfsplus_inode_info)
 
 static struct dentry *hfsplus_mount(struct file_system_type *fs_type,
-                         int flags, const char *dev_name, void *data)
+                                   int flags, const char *dev_name,
+                                   void *data, size_t data_size)
 {
-       return mount_bdev(fs_type, flags, dev_name, data, hfsplus_fill_super);
+       return mount_bdev(fs_type, flags, dev_name, data, data_size,
+                         hfsplus_fill_super);
 }
 
 static struct file_system_type hfsplus_fs_type = {
index 444c7b1703594403fb88c32efc5ae70af7c72f78..7af63cb655a3d55d60fe25a6910d45bc45fcbac8 100644 (file)
@@ -911,7 +911,8 @@ static const struct inode_operations hostfs_link_iops = {
        .get_link       = hostfs_get_link,
 };
 
-static int hostfs_fill_sb_common(struct super_block *sb, void *d, int silent)
+static int hostfs_fill_sb_common(struct super_block *sb,
+                                void *d, size_t data_size, int silent)
 {
        struct inode *root_inode;
        char *host_root_path, *req_root = d;
@@ -971,9 +972,9 @@ out:
 
 static struct dentry *hostfs_read_sb(struct file_system_type *type,
                          int flags, const char *dev_name,
-                         void *data)
+                         void *data, size_t data_size)
 {
-       return mount_nodev(type, flags, data, hostfs_fill_sb_common);
+       return mount_nodev(type, flags, data, data_size, hostfs_fill_sb_common);
 }
 
 static void hostfs_kill_sb(struct super_block *s)
index f2c3ebcd309c326d6ac08bd168f13b8b460379ec..53e585b27c050bcc92b99ba7f068b45c959286bd 100644 (file)
@@ -445,7 +445,8 @@ HPFS filesystem options:\n\
 \n");
 }
 
-static int hpfs_remount_fs(struct super_block *s, int *flags, char *data)
+static int hpfs_remount_fs(struct super_block *s, int *flags,
+                          char *data, size_t data_size)
 {
        kuid_t uid;
        kgid_t gid;
@@ -540,7 +541,8 @@ static const struct super_operations hpfs_sops =
        .show_options   = hpfs_show_options,
 };
 
-static int hpfs_fill_super(struct super_block *s, void *options, int silent)
+static int hpfs_fill_super(struct super_block *s,
+                          void *options, size_t data_size, int silent)
 {
        struct buffer_head *bh0, *bh1, *bh2;
        struct hpfs_boot_block *bootblock;
@@ -757,9 +759,10 @@ bail0:
 }
 
 static struct dentry *hpfs_mount(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data)
+       int flags, const char *dev_name, void *data, size_t data_size)
 {
-       return mount_bdev(fs_type, flags, dev_name, data, hpfs_fill_super);
+       return mount_bdev(fs_type, flags, dev_name, data, data_size,
+                         hpfs_fill_super);
 }
 
 static struct file_system_type hpfs_fs_type = {
index 32920a10100e23fc60f53cf36c882278ae972cee..4fa2e644fa118371824dc9db28244b0de3398429 100644 (file)
@@ -1220,7 +1220,8 @@ bad_val:
 }
 
 static int
-hugetlbfs_fill_super(struct super_block *sb, void *data, int silent)
+hugetlbfs_fill_super(struct super_block *sb, void *data, size_t data_size,
+                    int silent)
 {
        int ret;
        struct hugetlbfs_config config;
@@ -1279,9 +1280,10 @@ out_free:
 }
 
 static struct dentry *hugetlbfs_mount(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data)
+       int flags, const char *dev_name, void *data, size_t data_size)
 {
-       return mount_nodev(fs_type, flags, data, hugetlbfs_fill_super);
+       return mount_nodev(fs_type, flags, data, data_size,
+                          hugetlbfs_fill_super);
 }
 
 static struct file_system_type hugetlbfs_fs_type = {
@@ -1398,10 +1400,11 @@ static int __init init_hugetlbfs_fs(void)
        for_each_hstate(h) {
                char buf[50];
                unsigned ps_kb = 1U << (h->order + PAGE_SHIFT - 10);
+               int n;
 
-               snprintf(buf, sizeof(buf), "pagesize=%uK", ps_kb);
+               n = snprintf(buf, sizeof(buf), "pagesize=%uK", ps_kb);
                hugetlbfs_vfsmount[i] = kern_mount_data(&hugetlbfs_fs_type,
-                                                       buf);
+                                                       buf, n + 1);
 
                if (IS_ERR(hugetlbfs_vfsmount[i])) {
                        pr_err("Cannot mount internal hugetlbfs for "
index d410186bc369f9625d492387e3a99e6bcbb99703..364c20b5ea2d034a940946fac8be39015c01775d 100644 (file)
@@ -99,10 +99,10 @@ extern struct file *alloc_empty_file_noaccount(int, const struct cred *);
 /*
  * super.c
  */
-extern int do_remount_sb(struct super_block *, int, void *, int);
+extern int do_remount_sb(struct super_block *, int, void *, size_t, int);
 extern bool trylock_super(struct super_block *sb);
 extern struct dentry *mount_fs(struct file_system_type *,
-                              int, const char *, void *);
+                              int, const char *, void *, size_t);
 extern struct super_block *user_get_super(dev_t);
 
 /*
index 488a9e7f8f66020f4424b322db62eacdcbbdd057..729aac13299c23e254cf409de9fe17c949b020d6 100644 (file)
@@ -112,7 +112,8 @@ static void destroy_inodecache(void)
        kmem_cache_destroy(isofs_inode_cachep);
 }
 
-static int isofs_remount(struct super_block *sb, int *flags, char *data)
+static int isofs_remount(struct super_block *sb, int *flags,
+                        char *data, size_t data_size)
 {
        sync_filesystem(sb);
        if (!(*flags & SB_RDONLY))
@@ -620,7 +621,8 @@ static bool rootdir_empty(struct super_block *sb, unsigned long block)
  * Note: a check_disk_change() has been done immediately prior
  * to this call, so we don't need to check again.
  */
-static int isofs_fill_super(struct super_block *s, void *data, int silent)
+static int isofs_fill_super(struct super_block *s, void *data, size_t data_size,
+                           int silent)
 {
        struct buffer_head *bh = NULL, *pri_bh = NULL;
        struct hs_primary_descriptor *h_pri = NULL;
@@ -1565,9 +1567,10 @@ struct inode *__isofs_iget(struct super_block *sb,
 }
 
 static struct dentry *isofs_mount(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data)
+       int flags, const char *dev_name, void *data, size_t data_size)
 {
-       return mount_bdev(fs_type, flags, dev_name, data, isofs_fill_super);
+       return mount_bdev(fs_type, flags, dev_name, data, data_size,
+                         isofs_fill_super);
 }
 
 static struct file_system_type iso9660_fs_type = {
index 87bdf0f4cba117fc7c987080b9b901d7614ebfd3..c4f220f1a531e60eb7d95a6477b8126048793206 100644 (file)
@@ -238,7 +238,8 @@ static int jffs2_parse_options(struct jffs2_sb_info *c, char *data)
        return 0;
 }
 
-static int jffs2_remount_fs(struct super_block *sb, int *flags, char *data)
+static int jffs2_remount_fs(struct super_block *sb, int *flags,
+                           char *data, size_t data_size)
 {
        struct jffs2_sb_info *c = JFFS2_SB_INFO(sb);
        int err;
@@ -267,7 +268,8 @@ static const struct super_operations jffs2_super_operations =
 /*
  * fill in the superblock
  */
-static int jffs2_fill_super(struct super_block *sb, void *data, int silent)
+static int jffs2_fill_super(struct super_block *sb,
+                           void *data, size_t data_size, int silent)
 {
        struct jffs2_sb_info *c;
        int ret;
@@ -312,9 +314,9 @@ static int jffs2_fill_super(struct super_block *sb, void *data, int silent)
 
 static struct dentry *jffs2_mount(struct file_system_type *fs_type,
                        int flags, const char *dev_name,
-                       void *data)
+                       void *data, size_t data_size)
 {
-       return mount_mtd(fs_type, flags, dev_name, data, jffs2_fill_super);
+       return mount_mtd(fs_type, flags, dev_name, data, data_size, jffs2_fill_super);
 }
 
 static void jffs2_put_super (struct super_block *sb)
index 09da5cf14e2774022b1879eba30997a8035fc4da..de660a56150a951471ce20163f743c2c0f490e08 100644 (file)
@@ -456,7 +456,8 @@ cleanup:
        return 0;
 }
 
-static int jfs_remount(struct super_block *sb, int *flags, char *data)
+static int jfs_remount(struct super_block *sb, int *flags,
+                      char *data, size_t data_size)
 {
        s64 newLVSize = 0;
        int rc = 0;
@@ -516,7 +517,8 @@ static int jfs_remount(struct super_block *sb, int *flags, char *data)
        return 0;
 }
 
-static int jfs_fill_super(struct super_block *sb, void *data, int silent)
+static int jfs_fill_super(struct super_block *sb, void *data, size_t data_size,
+                         int silent)
 {
        struct jfs_sb_info *sbi;
        struct inode *inode;
@@ -698,9 +700,10 @@ out:
 }
 
 static struct dentry *jfs_do_mount(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data)
+       int flags, const char *dev_name, void *data, size_t data_size)
 {
-       return mount_bdev(fs_type, flags, dev_name, data, jfs_fill_super);
+       return mount_bdev(fs_type, flags, dev_name, data, data_size,
+                         jfs_fill_super);
 }
 
 static int jfs_sync_fs(struct super_block *sb, int wait)
index ff2716f9322e673d7a3e701c764c0f859ed84051..f70e0b69e714990c068affe8276d87ca6fb7ed39 100644 (file)
@@ -22,7 +22,8 @@
 
 struct kmem_cache *kernfs_node_cache;
 
-static int kernfs_sop_remount_fs(struct super_block *sb, int *flags, char *data)
+static int kernfs_sop_remount_fs(struct super_block *sb, int *flags,
+                                char *data, size_t data_size)
 {
        struct kernfs_root *root = kernfs_info(sb)->root;
        struct kernfs_syscall_ops *scops = root->syscall_ops;
index 0fb590d79f30ed78d0626fd79f24cacf9e1a72b8..9f1f4884b7cc80e57c5b4c9f00c4768e46cc2ddb 100644 (file)
@@ -578,7 +578,7 @@ int simple_pin_fs(struct file_system_type *type, struct vfsmount **mount, int *c
        spin_lock(&pin_fs_lock);
        if (unlikely(!*mount)) {
                spin_unlock(&pin_fs_lock);
-               mnt = vfs_kern_mount(type, SB_KERNMOUNT, type->name, NULL);
+               mnt = vfs_kern_mount(type, SB_KERNMOUNT, type->name, NULL, 0);
                if (IS_ERR(mnt))
                        return PTR_ERR(mnt);
                spin_lock(&pin_fs_lock);
index 72e308c3e66b91fa9a915ebcb6c31f7f62c432bc..3d91d9096b246b0aeeae5b5db6c952aab6c8da74 100644 (file)
@@ -22,7 +22,8 @@
 static int minix_write_inode(struct inode *inode,
                struct writeback_control *wbc);
 static int minix_statfs(struct dentry *dentry, struct kstatfs *buf);
-static int minix_remount (struct super_block * sb, int * flags, char * data);
+static int minix_remount (struct super_block * sb, int * flags,
+                         char * data, size_t data_size);
 
 static void minix_evict_inode(struct inode *inode)
 {
@@ -118,7 +119,8 @@ static const struct super_operations minix_sops = {
        .remount_fs     = minix_remount,
 };
 
-static int minix_remount (struct super_block * sb, int * flags, char * data)
+static int minix_remount (struct super_block * sb, int * flags,
+                         char * data, size_t data_size)
 {
        struct minix_sb_info * sbi = minix_sb(sb);
        struct minix_super_block * ms;
@@ -155,7 +157,8 @@ static int minix_remount (struct super_block * sb, int * flags, char * data)
        return 0;
 }
 
-static int minix_fill_super(struct super_block *s, void *data, int silent)
+static int minix_fill_super(struct super_block *s, void *data, size_t data_size,
+                           int silent)
 {
        struct buffer_head *bh;
        struct buffer_head **map;
@@ -651,9 +654,10 @@ void minix_truncate(struct inode * inode)
 }
 
 static struct dentry *minix_mount(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data)
+       int flags, const char *dev_name, void *data, size_t data_size)
 {
-       return mount_bdev(fs_type, flags, dev_name, data, minix_fill_super);
+       return mount_bdev(fs_type, flags, dev_name, data, data_size,
+                         minix_fill_super);
 }
 
 static struct file_system_type minix_fs_type = {
index 99186556f8d34ecfc89f27fb329b35dc2e42d114..8a7e1a7d1d067b307323f33d2c07b8c8a882ea21 100644 (file)
@@ -943,7 +943,8 @@ static struct mount *skip_mnt_tree(struct mount *p)
 }
 
 struct vfsmount *
-vfs_kern_mount(struct file_system_type *type, int flags, const char *name, void *data)
+vfs_kern_mount(struct file_system_type *type, int flags, const char *name,
+              void *data, size_t data_size)
 {
        struct mount *mnt;
        struct dentry *root;
@@ -958,7 +959,7 @@ vfs_kern_mount(struct file_system_type *type, int flags, const char *name, void
        if (flags & SB_KERNMOUNT)
                mnt->mnt.mnt_flags = MNT_INTERNAL;
 
-       root = mount_fs(type, flags, name, data);
+       root = mount_fs(type, flags, name, data, data_size);
        if (IS_ERR(root)) {
                mnt_free_id(mnt);
                free_vfsmnt(mnt);
@@ -978,7 +979,7 @@ EXPORT_SYMBOL_GPL(vfs_kern_mount);
 
 struct vfsmount *
 vfs_submount(const struct dentry *mountpoint, struct file_system_type *type,
-            const char *name, void *data)
+            const char *name, void *data, size_t data_size)
 {
        /* Until it is worked out how to pass the user namespace
         * through from the parent mount to the submount don't support
@@ -987,7 +988,7 @@ vfs_submount(const struct dentry *mountpoint, struct file_system_type *type,
        if (mountpoint->d_sb->s_user_ns != &init_user_ns)
                return ERR_PTR(-EPERM);
 
-       return vfs_kern_mount(type, SB_SUBMOUNT, name, data);
+       return vfs_kern_mount(type, SB_SUBMOUNT, name, data, data_size);
 }
 EXPORT_SYMBOL_GPL(vfs_submount);
 
@@ -1533,7 +1534,7 @@ static int do_umount(struct mount *mnt, int flags)
                        return -EPERM;
                down_write(&sb->s_umount);
                if (!sb_rdonly(sb))
-                       retval = do_remount_sb(sb, SB_RDONLY, NULL, 0);
+                       retval = do_remount_sb(sb, SB_RDONLY, NULL, 0, 0);
                up_write(&sb->s_umount);
                return retval;
        }
@@ -2226,7 +2227,7 @@ static int change_mount_flags(struct vfsmount *mnt, int ms_flags)
  * on it - tough luck.
  */
 static int do_remount(struct path *path, int ms_flags, int sb_flags,
-                     int mnt_flags, void *data)
+                     int mnt_flags, void *data, size_t data_size)
 {
        int err;
        struct super_block *sb = path->mnt->mnt_sb;
@@ -2265,7 +2266,7 @@ static int do_remount(struct path *path, int ms_flags, int sb_flags,
                return -EPERM;
        }
 
-       err = security_sb_remount(sb, data);
+       err = security_sb_remount(sb, data, data_size);
        if (err)
                return err;
 
@@ -2275,7 +2276,7 @@ static int do_remount(struct path *path, int ms_flags, int sb_flags,
        else if (!ns_capable(sb->s_user_ns, CAP_SYS_ADMIN))
                err = -EPERM;
        else
-               err = do_remount_sb(sb, sb_flags, data, 0);
+               err = do_remount_sb(sb, sb_flags, data, data_size, 0);
        if (!err) {
                lock_mount_hash();
                mnt_flags |= mnt->mnt.mnt_flags & ~MNT_USER_SETTABLE_MASK;
@@ -2441,7 +2442,8 @@ static bool mount_too_revealing(struct vfsmount *mnt, int *new_mnt_flags);
  * namespace's tree
  */
 static int do_new_mount(struct path *path, const char *fstype, int sb_flags,
-                       int mnt_flags, const char *name, void *data)
+                       int mnt_flags, const char *name,
+                       void *data, size_t data_size)
 {
        struct file_system_type *type;
        struct vfsmount *mnt;
@@ -2454,7 +2456,7 @@ static int do_new_mount(struct path *path, const char *fstype, int sb_flags,
        if (!type)
                return -ENODEV;
 
-       mnt = vfs_kern_mount(type, sb_flags, name, data);
+       mnt = vfs_kern_mount(type, sb_flags, name, data, data_size);
        if (!IS_ERR(mnt) && (type->fs_flags & FS_HAS_SUBTYPE) &&
            !mnt->mnt_sb->s_subtype)
                mnt = fs_set_subtype(mnt, fstype);
@@ -2710,6 +2712,7 @@ long do_mount(const char *dev_name, const char __user *dir_name,
 {
        struct path path;
        unsigned int mnt_flags = 0, sb_flags;
+       size_t data_size = data_page ? PAGE_SIZE : 0;
        int retval = 0;
 
        /* Discard magic */
@@ -2728,8 +2731,8 @@ long do_mount(const char *dev_name, const char __user *dir_name,
        if (retval)
                return retval;
 
-       retval = security_sb_mount(dev_name, &path,
-                                  type_page, flags, data_page);
+       retval = security_sb_mount(dev_name, &path, type_page, flags,
+                                  data_page, data_size);
        if (!retval && !may_mount())
                retval = -EPERM;
        if (!retval && (flags & SB_MANDLOCK) && !may_mandlock())
@@ -2776,7 +2779,7 @@ long do_mount(const char *dev_name, const char __user *dir_name,
 
        if (flags & MS_REMOUNT)
                retval = do_remount(&path, flags, sb_flags, mnt_flags,
-                                   data_page);
+                                   data_page, data_size);
        else if (flags & MS_BIND)
                retval = do_loopback(&path, dev_name, flags & MS_REC);
        else if (flags & (MS_SHARED | MS_PRIVATE | MS_SLAVE | MS_UNBINDABLE))
@@ -2785,7 +2788,7 @@ long do_mount(const char *dev_name, const char __user *dir_name,
                retval = do_move_mount(&path, dev_name);
        else
                retval = do_new_mount(&path, type_page, sb_flags, mnt_flags,
-                                     dev_name, data_page);
+                                     dev_name, data_page, data_size);
 dput_out:
        path_put(&path);
        return retval;
@@ -3175,7 +3178,7 @@ static void __init init_mount_tree(void)
        type = get_fs_type("rootfs");
        if (!type)
                panic("Can't find rootfs type");
-       mnt = vfs_kern_mount(type, 0, "rootfs", NULL);
+       mnt = vfs_kern_mount(type, 0, "rootfs", NULL, 0);
        put_filesystem(type);
        if (IS_ERR(mnt))
                panic("Can't create rootfs");
@@ -3237,10 +3240,11 @@ void put_mnt_ns(struct mnt_namespace *ns)
        free_mnt_ns(ns);
 }
 
-struct vfsmount *kern_mount_data(struct file_system_type *type, void *data)
+struct vfsmount *kern_mount_data(struct file_system_type *type,
+                                void *data, size_t data_size)
 {
        struct vfsmount *mnt;
-       mnt = vfs_kern_mount(type, SB_KERNMOUNT, type->name, data);
+       mnt = vfs_kern_mount(type, SB_KERNMOUNT, type->name, data, data_size);
        if (!IS_ERR(mnt)) {
                /*
                 * it is a longterm mount, don't release mnt until
index 8357ff69962f22caae59d1ac357058d89800e963..db0f3ca3a35cddcc7cb66e2e4257b70da9102340 100644 (file)
@@ -405,7 +405,7 @@ int nfs_set_sb_security(struct super_block *, struct dentry *, struct nfs_mount_
 int nfs_clone_sb_security(struct super_block *, struct dentry *, struct nfs_mount_info *);
 struct dentry *nfs_fs_mount_common(struct nfs_server *, int, const char *,
                                   struct nfs_mount_info *, struct nfs_subversion *);
-struct dentry *nfs_fs_mount(struct file_system_type *, int, const char *, void *);
+struct dentry *nfs_fs_mount(struct file_system_type *, int, const char *, void *, size_t);
 struct dentry * nfs_xdev_mount_common(struct file_system_type *, int,
                const char *, struct nfs_mount_info *);
 void nfs_kill_super(struct super_block *);
@@ -466,7 +466,7 @@ int  nfs_show_options(struct seq_file *, struct dentry *);
 int  nfs_show_devname(struct seq_file *, struct dentry *);
 int  nfs_show_path(struct seq_file *, struct dentry *);
 int  nfs_show_stats(struct seq_file *, struct dentry *);
-int nfs_remount(struct super_block *sb, int *flags, char *raw_data);
+int nfs_remount(struct super_block *sb, int *flags, char *raw_data, size_t data_size);
 
 /* write.c */
 extern void nfs_pageio_init_write(struct nfs_pageio_descriptor *pgio,
index e5686be67be8d361a32344e3aaaae235d739ffd7..df9e87331558a800a0f8d9ca045d2eada45683a3 100644 (file)
@@ -216,7 +216,8 @@ static struct vfsmount *nfs_do_clone_mount(struct nfs_server *server,
                                           const char *devname,
                                           struct nfs_clone_mount *mountdata)
 {
-       return vfs_submount(mountdata->dentry, &nfs_xdev_fs_type, devname, mountdata);
+       return vfs_submount(mountdata->dentry, &nfs_xdev_fs_type, devname,
+                           mountdata, 0);
 }
 
 /**
index 24f06dcc2b08eeabd9f6b14591584cf8676749c8..191cb420205667139acde61189653feac3649c6d 100644 (file)
@@ -278,7 +278,8 @@ static struct vfsmount *try_location(struct nfs_clone_mount *mountdata,
                                mountdata->hostname,
                                mountdata->mnt_path);
 
-               mnt = vfs_submount(mountdata->dentry, &nfs4_referral_fs_type, page, mountdata);
+               mnt = vfs_submount(mountdata->dentry, &nfs4_referral_fs_type, page,
+                                  mountdata, 0);
                if (!IS_ERR(mnt))
                        break;
        }
index 6fb7cb6b3f4b038398e3c8ef1681cc4d274636a5..e72e5dbdfcd0318570465fba242be66559de3416 100644 (file)
 static int nfs4_write_inode(struct inode *inode, struct writeback_control *wbc);
 static void nfs4_evict_inode(struct inode *inode);
 static struct dentry *nfs4_remote_mount(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *raw_data);
+       int flags, const char *dev_name, void *raw_data, size_t data_size);
 static struct dentry *nfs4_referral_mount(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *raw_data);
+       int flags, const char *dev_name, void *raw_data, size_t data_size);
 static struct dentry *nfs4_remote_referral_mount(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *raw_data);
+       int flags, const char *dev_name, void *raw_data, size_t data_size);
 
 static struct file_system_type nfs4_remote_fs_type = {
        .owner          = THIS_MODULE,
@@ -105,7 +105,7 @@ static void nfs4_evict_inode(struct inode *inode)
  */
 static struct dentry *
 nfs4_remote_mount(struct file_system_type *fs_type, int flags,
-                 const char *dev_name, void *info)
+                 const char *dev_name, void *info, size_t data_size)
 {
        struct nfs_mount_info *mount_info = info;
        struct nfs_server *server;
@@ -127,7 +127,7 @@ out:
 }
 
 static struct vfsmount *nfs_do_root_mount(struct file_system_type *fs_type,
-               int flags, void *data, const char *hostname)
+               int flags, void *data, size_t data_size, const char *hostname)
 {
        struct vfsmount *root_mnt;
        char *root_devname;
@@ -142,7 +142,8 @@ static struct vfsmount *nfs_do_root_mount(struct file_system_type *fs_type,
                snprintf(root_devname, len, "[%s]:/", hostname);
        else
                snprintf(root_devname, len, "%s:/", hostname);
-       root_mnt = vfs_kern_mount(fs_type, flags, root_devname, data);
+       root_mnt = vfs_kern_mount(fs_type, flags, root_devname,
+                                 data, data_size);
        kfree(root_devname);
        return root_mnt;
 }
@@ -247,8 +248,8 @@ struct dentry *nfs4_try_mount(int flags, const char *dev_name,
 
        export_path = data->nfs_server.export_path;
        data->nfs_server.export_path = "/";
-       root_mnt = nfs_do_root_mount(&nfs4_remote_fs_type, flags, mount_info,
-                       data->nfs_server.hostname);
+       root_mnt = nfs_do_root_mount(&nfs4_remote_fs_type, flags, mount_info, 0,
+                                    data->nfs_server.hostname);
        data->nfs_server.export_path = export_path;
 
        res = nfs_follow_remote_path(root_mnt, export_path);
@@ -261,7 +262,8 @@ struct dentry *nfs4_try_mount(int flags, const char *dev_name,
 
 static struct dentry *
 nfs4_remote_referral_mount(struct file_system_type *fs_type, int flags,
-                          const char *dev_name, void *raw_data)
+                          const char *dev_name,
+                          void *raw_data, size_t data_size)
 {
        struct nfs_mount_info mount_info = {
                .fill_super = nfs_fill_super,
@@ -294,7 +296,8 @@ out:
  * Create an NFS4 server record on referral traversal
  */
 static struct dentry *nfs4_referral_mount(struct file_system_type *fs_type,
-               int flags, const char *dev_name, void *raw_data)
+                                         int flags, const char *dev_name,
+                                         void *raw_data, size_t data_size)
 {
        struct nfs_clone_mount *data = raw_data;
        char *export_path;
@@ -306,8 +309,8 @@ static struct dentry *nfs4_referral_mount(struct file_system_type *fs_type,
        export_path = data->mnt_path;
        data->mnt_path = "/";
 
-       root_mnt = nfs_do_root_mount(&nfs4_remote_referral_fs_type,
-                       flags, data, data->hostname);
+       root_mnt = nfs_do_root_mount(&nfs4_remote_referral_fs_type, flags,
+                                    data, 0, data->hostname);
        data->mnt_path = export_path;
 
        res = nfs_follow_remote_path(root_mnt, export_path);
index ac4b2f005778c05df1bb68117f66fd407f20a529..21f12b79348a917b12f38b43bd94c8bb3d6bf9d8 100644 (file)
@@ -287,7 +287,8 @@ static match_table_t nfs_vers_tokens = {
 };
 
 static struct dentry *nfs_xdev_mount(struct file_system_type *fs_type,
-               int flags, const char *dev_name, void *raw_data);
+                                    int flags, const char *dev_name,
+                                    void *raw_data, size_t data_size);
 
 struct file_system_type nfs_fs_type = {
        .owner          = THIS_MODULE,
@@ -1203,7 +1204,7 @@ static int nfs_get_option_ul_bound(substring_t args[], unsigned long *option,
  * skipped as they are encountered.  If there were no errors, return 1;
  * otherwise return 0 (zero).
  */
-static int nfs_parse_mount_options(char *raw,
+static int nfs_parse_mount_options(char *raw, size_t raw_size,
                                   struct nfs_parsed_mount_data *mnt)
 {
        char *p, *string, *secdata;
@@ -1221,7 +1222,7 @@ static int nfs_parse_mount_options(char *raw,
        if (!secdata)
                goto out_nomem;
 
-       rc = security_sb_copy_data(raw, secdata);
+       rc = security_sb_copy_data(raw, raw_size, secdata);
        if (rc)
                goto out_security_failure;
 
@@ -2151,7 +2152,7 @@ static int nfs_validate_mount_data(struct file_system_type *fs_type,
 }
 #endif
 
-static int nfs_validate_text_mount_data(void *options,
+static int nfs_validate_text_mount_data(void *options, size_t data_size,
                                        struct nfs_parsed_mount_data *args,
                                        const char *dev_name)
 {
@@ -2160,7 +2161,7 @@ static int nfs_validate_text_mount_data(void *options,
        int max_pathlen = NFS_MAXPATHLEN;
        struct sockaddr *sap = (struct sockaddr *)&args->nfs_server.address;
 
-       if (nfs_parse_mount_options((char *)options, args) == 0)
+       if (nfs_parse_mount_options((char *)options, data_size, args) == 0)
                return -EINVAL;
 
        if (!nfs_verify_server_address(sap))
@@ -2243,7 +2244,7 @@ nfs_compare_remount_data(struct nfs_server *nfss,
 }
 
 int
-nfs_remount(struct super_block *sb, int *flags, char *raw_data)
+nfs_remount(struct super_block *sb, int *flags, char *raw_data, size_t data_size)
 {
        int error;
        struct nfs_server *nfss = sb->s_fs_info;
@@ -2290,7 +2291,7 @@ nfs_remount(struct super_block *sb, int *flags, char *raw_data)
 
        /* overwrite those values with any that were specified */
        error = -EINVAL;
-       if (!nfs_parse_mount_options((char *)options, data))
+       if (!nfs_parse_mount_options((char *)options, data_size, data))
                goto out;
 
        /*
@@ -2662,7 +2663,7 @@ error_splat_super:
 EXPORT_SYMBOL_GPL(nfs_fs_mount_common);
 
 struct dentry *nfs_fs_mount(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *raw_data)
+       int flags, const char *dev_name, void *raw_data, size_t data_size)
 {
        struct nfs_mount_info mount_info = {
                .fill_super = nfs_fill_super,
@@ -2680,7 +2681,8 @@ struct dentry *nfs_fs_mount(struct file_system_type *fs_type,
        /* Validate the mount data */
        error = nfs_validate_mount_data(fs_type, raw_data, mount_info.parsed, mount_info.mntfh, dev_name);
        if (error == NFS_TEXT_DATA)
-               error = nfs_validate_text_mount_data(raw_data, mount_info.parsed, dev_name);
+               error = nfs_validate_text_mount_data(raw_data, data_size,
+                                                    mount_info.parsed, dev_name);
        if (error < 0) {
                mntroot = ERR_PTR(error);
                goto out;
@@ -2724,7 +2726,7 @@ EXPORT_SYMBOL_GPL(nfs_kill_super);
  */
 static struct dentry *
 nfs_xdev_mount(struct file_system_type *fs_type, int flags,
-               const char *dev_name, void *raw_data)
+               const char *dev_name, void *raw_data, size_t data_size)
 {
        struct nfs_clone_mount *data = raw_data;
        struct nfs_mount_info mount_info = {
index 7fb9f7c667b11077adc4afacb20d5c75319c5841..6676d7e00294c07c5a58c7e216d12283c7173d09 100644 (file)
@@ -1144,7 +1144,8 @@ static ssize_t write_v4_end_grace(struct file *file, char *buf, size_t size)
  *     populating the filesystem.
  */
 
-static int nfsd_fill_super(struct super_block * sb, void * data, int silent)
+static int nfsd_fill_super(struct super_block * sb,
+                          void * data, size_t data_size, int silent)
 {
        static const struct tree_descr nfsd_files[] = {
                [NFSD_List] = {"exports", &exports_nfsd_operations, S_IRUGO},
@@ -1179,10 +1180,11 @@ static int nfsd_fill_super(struct super_block * sb, void * data, int silent)
 }
 
 static struct dentry *nfsd_mount(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data)
+       int flags, const char *dev_name, void *data, size_t data_size)
 {
        struct net *net = current->nsproxy->net_ns;
-       return mount_ns(fs_type, flags, data, net, net->user_ns, nfsd_fill_super);
+       return mount_ns(fs_type, flags, data, data_size,
+                       net, net->user_ns, nfsd_fill_super);
 }
 
 static void nfsd_umount(struct super_block *sb)
index 26290aa1023f31950017cdba5c31fb589934e701..81b66c609ca6151c638f34605df1a3feedec8c54 100644 (file)
@@ -60,7 +60,8 @@ struct kmem_cache *nilfs_segbuf_cachep;
 struct kmem_cache *nilfs_btree_path_cache;
 
 static int nilfs_setup_super(struct super_block *sb, int is_mount);
-static int nilfs_remount(struct super_block *sb, int *flags, char *data);
+static int nilfs_remount(struct super_block *sb, int *flags,
+                        char *data, size_t data_size);
 
 void __nilfs_msg(struct super_block *sb, const char *level, const char *fmt,
                 ...)
@@ -1109,7 +1110,8 @@ nilfs_fill_super(struct super_block *sb, void *data, int silent)
        return err;
 }
 
-static int nilfs_remount(struct super_block *sb, int *flags, char *data)
+static int nilfs_remount(struct super_block *sb, int *flags,
+                        char *data, size_t data_size)
 {
        struct the_nilfs *nilfs = sb->s_fs_info;
        unsigned long old_sb_flags;
@@ -1269,7 +1271,7 @@ static int nilfs_test_bdev_super(struct super_block *s, void *data)
 
 static struct dentry *
 nilfs_mount(struct file_system_type *fs_type, int flags,
-            const char *dev_name, void *data)
+           const char *dev_name, void *data, size_t data_size)
 {
        struct nilfs_super_data sd;
        struct super_block *s;
@@ -1337,7 +1339,7 @@ nilfs_mount(struct file_system_type *fs_type, int flags,
                         * Try remount to setup mount states if the current
                         * tree is not mounted and only snapshots use this sb.
                         */
-                       err = nilfs_remount(s, &flags, data);
+                       err = nilfs_remount(s, &flags, data, data_size);
                        if (err)
                                goto failed_super;
                }
index 60702d677bd4e5b11add7dce14e37967a4998355..f069eb6495b0bca62ac3684bf994024400a0122f 100644 (file)
--- a/fs/nsfs.c
+++ b/fs/nsfs.c
@@ -263,7 +263,8 @@ static const struct super_operations nsfs_ops = {
        .show_path = nsfs_show_path,
 };
 static struct dentry *nsfs_mount(struct file_system_type *fs_type,
-                       int flags, const char *dev_name, void *data)
+                                int flags, const char *dev_name,
+                                void *data, size_t data_size)
 {
        return mount_pseudo(fs_type, "nsfs:", &nsfs_ops,
                        &ns_dentry_operations, NSFS_MAGIC);
index bb7159f697f2f3f45713ef26a327b1339f1a30bc..8501bbcceb5af5bfe25b15860cef53e3469433a2 100644 (file)
@@ -456,6 +456,7 @@ static inline int ntfs_clear_volume_flags(ntfs_volume *vol, VOLUME_FLAGS flags)
  * @sb:                superblock of mounted ntfs filesystem
  * @flags:     remount flags
  * @opt:       remount options string
+ * @data_size: size of the options string
  *
  * Change the mount options of an already mounted ntfs filesystem.
  *
@@ -463,7 +464,8 @@ static inline int ntfs_clear_volume_flags(ntfs_volume *vol, VOLUME_FLAGS flags)
  * ntfs_remount() returns successfully (i.e. returns 0).  Otherwise,
  * @sb->s_flags are not changed.
  */
-static int ntfs_remount(struct super_block *sb, int *flags, char *opt)
+static int ntfs_remount(struct super_block *sb, int *flags,
+                       char *opt, size_t data_size)
 {
        ntfs_volume *vol = NTFS_SB(sb);
 
@@ -2694,6 +2696,7 @@ static const struct super_operations ntfs_sops = {
  * ntfs_fill_super - mount an ntfs filesystem
  * @sb:                super block of ntfs filesystem to mount
  * @opt:       string containing the mount options
+ * @data_size: size of the mount options string
  * @silent:    silence error output
  *
  * ntfs_fill_super() is called by the VFS to mount the device described by @sb
@@ -2708,7 +2711,8 @@ static const struct super_operations ntfs_sops = {
  *
  * NOTE: @sb->s_flags contains the mount options flags.
  */
-static int ntfs_fill_super(struct super_block *sb, void *opt, const int silent)
+static int ntfs_fill_super(struct super_block *sb, void *opt, size_t data_size,
+                          const int silent)
 {
        ntfs_volume *vol;
        struct buffer_head *bh;
@@ -3060,9 +3064,10 @@ struct kmem_cache *ntfs_index_ctx_cache;
 DEFINE_MUTEX(ntfs_lock);
 
 static struct dentry *ntfs_mount(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data)
+       int flags, const char *dev_name, void *data, size_t data_size)
 {
-       return mount_bdev(fs_type, flags, dev_name, data, ntfs_fill_super);
+       return mount_bdev(fs_type, flags, dev_name, data, data_size,
+                         ntfs_fill_super);
 }
 
 static struct file_system_type ntfs_fs_type = {
index 602c71f32740941e57d34a1aa21a3af48a4b60d4..642e471a6472d487ac937509f7480901390d6ae6 100644 (file)
@@ -568,6 +568,7 @@ bail:
 
 static int dlmfs_fill_super(struct super_block * sb,
                            void * data,
+                           size_t data_size,
                            int silent)
 {
        sb->s_maxbytes = MAX_LFS_FILESIZE;
@@ -617,9 +618,9 @@ static const struct inode_operations dlmfs_file_inode_operations = {
 };
 
 static struct dentry *dlmfs_mount(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data)
+       int flags, const char *dev_name, void *data, size_t data_size)
 {
-       return mount_nodev(fs_type, flags, data, dlmfs_fill_super);
+       return mount_nodev(fs_type, flags, data, data_size, dlmfs_fill_super);
 }
 
 static struct file_system_type dlmfs_fs_type = {
index 3415e0b09398fb50a813499f14596db104cd414c..62237837a098c95d50c67836629147682d53a58e 100644 (file)
@@ -107,7 +107,8 @@ static int ocfs2_check_set_options(struct super_block *sb,
 static int ocfs2_show_options(struct seq_file *s, struct dentry *root);
 static void ocfs2_put_super(struct super_block *sb);
 static int ocfs2_mount_volume(struct super_block *sb);
-static int ocfs2_remount(struct super_block *sb, int *flags, char *data);
+static int ocfs2_remount(struct super_block *sb, int *flags,
+                        char *data, size_t data_size);
 static void ocfs2_dismount_volume(struct super_block *sb, int mnt_err);
 static int ocfs2_initialize_mem_caches(void);
 static void ocfs2_free_mem_caches(void);
@@ -633,7 +634,8 @@ static unsigned long long ocfs2_max_file_offset(unsigned int bbits,
        return (((unsigned long long)bytes) << bitshift) - trim;
 }
 
-static int ocfs2_remount(struct super_block *sb, int *flags, char *data)
+static int ocfs2_remount(struct super_block *sb, int *flags,
+                        char *data, size_t data_size)
 {
        int incompat_features;
        int ret = 0;
@@ -999,7 +1001,8 @@ static void ocfs2_disable_quotas(struct ocfs2_super *osb)
        }
 }
 
-static int ocfs2_fill_super(struct super_block *sb, void *data, int silent)
+static int ocfs2_fill_super(struct super_block *sb, void *data, size_t data_size,
+                           int silent)
 {
        struct dentry *root;
        int status, sector_size;
@@ -1236,9 +1239,10 @@ read_super_error:
 static struct dentry *ocfs2_mount(struct file_system_type *fs_type,
                        int flags,
                        const char *dev_name,
-                       void *data)
+                       void *data, size_t data_size)
 {
-       return mount_bdev(fs_type, flags, dev_name, data, ocfs2_fill_super);
+       return mount_bdev(fs_type, flags, dev_name, data, data_size,
+                         ocfs2_fill_super);
 }
 
 static struct file_system_type ocfs2_fs_type = {
index ee14af9e26f28f16d91076cc8b62b87b306afb52..e5258fefcd2bc901721108b1bd3bd4ef36f75b79 100644 (file)
@@ -454,7 +454,8 @@ static int parse_options(char *options, struct omfs_sb_info *sbi)
        return 1;
 }
 
-static int omfs_fill_super(struct super_block *sb, void *data, int silent)
+static int omfs_fill_super(struct super_block *sb, void *data, size_t data_size,
+                          int silent)
 {
        struct buffer_head *bh, *bh2;
        struct omfs_super_block *omfs_sb;
@@ -596,9 +597,11 @@ end:
 }
 
 static struct dentry *omfs_mount(struct file_system_type *fs_type,
-                       int flags, const char *dev_name, void *data)
+                                int flags, const char *dev_name,
+                                void *data, size_t data_size)
 {
-       return mount_bdev(fs_type, flags, dev_name, data, omfs_fill_super);
+       return mount_bdev(fs_type, flags, dev_name, data, data_size,
+                         omfs_fill_super);
 }
 
 static struct file_system_type omfs_fs_type = {
index 607092f367ad9294fa7401047a7efc6605063d82..e11c042b47662236d6765eee7aa40fd4f57c8952 100644 (file)
@@ -365,7 +365,8 @@ static struct inode *openprom_iget(struct super_block *sb, ino_t ino)
        return inode;
 }
 
-static int openprom_remount(struct super_block *sb, int *flags, char *data)
+static int openprom_remount(struct super_block *sb, int *flags,
+                           char *data, size_t data_size)
 {
        sync_filesystem(sb);
        *flags |= SB_NOATIME;
@@ -379,7 +380,8 @@ static const struct super_operations openprom_sops = {
        .remount_fs     = openprom_remount,
 };
 
-static int openprom_fill_super(struct super_block *s, void *data, int silent)
+static int openprom_fill_super(struct super_block *s,
+                              void *data, size_t data_size, int silent)
 {
        struct inode *root_inode;
        struct op_inode_info *oi;
@@ -414,9 +416,10 @@ out_no_root:
 }
 
 static struct dentry *openprom_mount(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data)
+       int flags, const char *dev_name, void *data, size_t data_size)
 {
-       return mount_single(fs_type, flags, data, openprom_fill_super);
+       return mount_single(fs_type, flags, data, data_size,
+                           openprom_fill_super);
 }
 
 static struct file_system_type openprom_fs_type = {
index 17b24ad6b264b1733e2ee081a1bb44ab85253e46..ed38b9a5e43a231a90542913bb2ad52cb634f506 100644 (file)
@@ -318,7 +318,7 @@ extern uint64_t orangefs_features;
 struct dentry *orangefs_mount(struct file_system_type *fst,
                           int flags,
                           const char *devname,
-                          void *data);
+                          void *data, size_t data_size);
 
 void orangefs_kill_sb(struct super_block *sb);
 int orangefs_remount(struct orangefs_sb_info_s *);
index dfaee90d30bdedf98ccfb6cc1df1aafa6ba85eab..784daf6667d1540cd10e0c5a71200c13c1f82cde 100644 (file)
@@ -207,7 +207,8 @@ out_op_release:
  * Remount as initiated by VFS layer.  We just need to reparse the mount
  * options, no need to signal pvfs2-client-core about it.
  */
-static int orangefs_remount_fs(struct super_block *sb, int *flags, char *data)
+static int orangefs_remount_fs(struct super_block *sb, int *flags,
+                              char *data, size_t data_size)
 {
        gossip_debug(GOSSIP_SUPER_DEBUG, "orangefs_remount_fs: called\n");
        return parse_mount_options(sb, data, 1);
@@ -457,7 +458,7 @@ static int orangefs_fill_sb(struct super_block *sb,
 struct dentry *orangefs_mount(struct file_system_type *fst,
                           int flags,
                           const char *devname,
-                          void *data)
+                          void *data, size_t data_size)
 {
        int ret = -EINVAL;
        struct super_block *sb = ERR_PTR(-EINVAL);
index 2e0fc93c2c06646ccf5c67c43836f9d4989da501..8aac028554b6ca3d11b892b02d707ddbb38b67c4 100644 (file)
@@ -365,7 +365,8 @@ static int ovl_show_options(struct seq_file *m, struct dentry *dentry)
        return 0;
 }
 
-static int ovl_remount(struct super_block *sb, int *flags, char *data)
+static int ovl_remount(struct super_block *sb, int *flags,
+                      char *data, size_t data_size)
 {
        struct ovl_fs *ofs = sb->s_fs_info;
 
@@ -1366,7 +1367,8 @@ out_err:
        goto out;
 }
 
-static int ovl_fill_super(struct super_block *sb, void *data, int silent)
+static int ovl_fill_super(struct super_block *sb, void *data, size_t data_size,
+                         int silent)
 {
        struct path upperpath = { };
        struct dentry *root_dentry;
@@ -1511,9 +1513,10 @@ out:
 }
 
 static struct dentry *ovl_mount(struct file_system_type *fs_type, int flags,
-                               const char *dev_name, void *raw_data)
+                               const char *dev_name,
+                               void *raw_data, size_t data_size)
 {
-       return mount_nodev(fs_type, flags, raw_data, ovl_fill_super);
+       return mount_nodev(fs_type, flags, raw_data, data_size, ovl_fill_super);
 }
 
 static struct file_system_type ovl_fs_type = {
index bdc5d3c0977d09b37d5eb80abfb92c3a336f6c92..d1b2ba38ebb28f36d90106fcb3cf4d38f401baed 100644 (file)
--- a/fs/pipe.c
+++ b/fs/pipe.c
@@ -1158,7 +1158,8 @@ static const struct super_operations pipefs_ops = {
  * d_name - pipe: will go nicely and kill the special-casing in procfs.
  */
 static struct dentry *pipefs_mount(struct file_system_type *fs_type,
-                        int flags, const char *dev_name, void *data)
+                                  int flags, const char *dev_name,
+                                  void *data, size_t data_size)
 {
        return mount_pseudo(fs_type, "pipe:", &pipefs_ops,
                        &pipefs_dentry_operations, PIPEFS_MAGIC);
index fc5306a31a1d8b489dc16483d79cf83b6445f387..8f121c476c073dfa135f475c1e4c41e20344d3fe 100644 (file)
@@ -491,7 +491,8 @@ struct inode *proc_get_inode(struct super_block *sb, struct proc_dir_entry *de)
        return inode;
 }
 
-int proc_fill_super(struct super_block *s, void *data, int silent)
+int proc_fill_super(struct super_block *s, void *data, size_t data_size,
+                   int silent)
 {
        struct pid_namespace *ns = get_pid_ns(s->s_fs_info);
        struct inode *root_inode;
index 5185d7f6a51ee845fc12c6d49d4497d766af6c23..3b88db52d206eec7871df446bd29bf5f107a14be 100644 (file)
@@ -211,7 +211,7 @@ extern const struct inode_operations proc_pid_link_inode_operations;
 void proc_init_kmemcache(void);
 void set_proc_pid_nlink(void);
 extern struct inode *proc_get_inode(struct super_block *, struct proc_dir_entry *);
-extern int proc_fill_super(struct super_block *, void *data, int flags);
+extern int proc_fill_super(struct super_block *, void *, size_t, int);
 extern void proc_entry_rundown(struct proc_dir_entry *);
 
 /*
@@ -272,7 +272,7 @@ extern struct proc_dir_entry proc_root;
 extern int proc_parse_options(char *options, struct pid_namespace *pid);
 
 extern void proc_self_init(void);
-extern int proc_remount(struct super_block *, int *, char *);
+extern int proc_remount(struct super_block *, int *, char *, size_t);
 
 /*
  * task_[no]mmu.c
index f4b1a9d2eca6010be2838197dc9741ec67a3857e..28fadb0c51ab7a5b97413b2e54266793b336fc75 100644 (file)
@@ -78,7 +78,8 @@ int proc_parse_options(char *options, struct pid_namespace *pid)
        return 1;
 }
 
-int proc_remount(struct super_block *sb, int *flags, char *data)
+int proc_remount(struct super_block *sb, int *flags,
+                char *data, size_t data_size)
 {
        struct pid_namespace *pid = sb->s_fs_info;
 
@@ -87,7 +88,8 @@ int proc_remount(struct super_block *sb, int *flags, char *data)
 }
 
 static struct dentry *proc_mount(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data)
+                                int flags, const char *dev_name,
+                                void *data, size_t data_size)
 {
        struct pid_namespace *ns;
 
@@ -98,7 +100,8 @@ static struct dentry *proc_mount(struct file_system_type *fs_type,
                ns = task_active_pid_ns(current);
        }
 
-       return mount_ns(fs_type, flags, data, ns, ns->user_ns, proc_fill_super);
+       return mount_ns(fs_type, flags, data, data_size, ns, ns->user_ns,
+                       proc_fill_super);
 }
 
 static void proc_kill_sb(struct super_block *sb)
@@ -211,7 +214,7 @@ int pid_ns_prepare_proc(struct pid_namespace *ns)
 {
        struct vfsmount *mnt;
 
-       mnt = kern_mount_data(&proc_fs_type, ns);
+       mnt = kern_mount_data(&proc_fs_type, ns, 0);
        if (IS_ERR(mnt))
                return PTR_ERR(mnt);
 
index 5fcb845b9fec1295c1a3a894acf8c2ce042d3f17..793258231096c539222e2f4c4858132b8711e685 100644 (file)
@@ -271,7 +271,8 @@ static int pstore_show_options(struct seq_file *m, struct dentry *root)
        return 0;
 }
 
-static int pstore_remount(struct super_block *sb, int *flags, char *data)
+static int pstore_remount(struct super_block *sb, int *flags,
+                         char *data, size_t data_size)
 {
        sync_filesystem(sb);
        parse_options(data);
@@ -432,7 +433,8 @@ void pstore_get_records(int quiet)
        inode_unlock(d_inode(root));
 }
 
-static int pstore_fill_super(struct super_block *sb, void *data, int silent)
+static int pstore_fill_super(struct super_block *sb,
+                            void *data, size_t data_size, int silent)
 {
        struct inode *inode;
 
@@ -464,9 +466,9 @@ static int pstore_fill_super(struct super_block *sb, void *data, int silent)
 }
 
 static struct dentry *pstore_mount(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data)
+       int flags, const char *dev_name, void *data, size_t data_size)
 {
-       return mount_single(fs_type, flags, data, pstore_fill_super);
+       return mount_single(fs_type, flags, data, data_size, pstore_fill_super);
 }
 
 static void pstore_kill_sb(struct super_block *sb)
index 3d46fe302fcb15372c40461a64107e02c29ee97d..be35529c80521200a1d14dff77367e9d32015250 100644 (file)
@@ -29,7 +29,8 @@ static const struct super_operations qnx4_sops;
 
 static struct inode *qnx4_alloc_inode(struct super_block *sb);
 static void qnx4_destroy_inode(struct inode *inode);
-static int qnx4_remount(struct super_block *sb, int *flags, char *data);
+static int qnx4_remount(struct super_block *sb, int *flags,
+                       char *data, size_t data_size);
 static int qnx4_statfs(struct dentry *, struct kstatfs *);
 
 static const struct super_operations qnx4_sops =
@@ -40,7 +41,8 @@ static const struct super_operations qnx4_sops =
        .remount_fs     = qnx4_remount,
 };
 
-static int qnx4_remount(struct super_block *sb, int *flags, char *data)
+static int qnx4_remount(struct super_block *sb, int *flags,
+                       char *data, size_t data_size)
 {
        struct qnx4_sb_info *qs;
 
@@ -183,7 +185,8 @@ static const char *qnx4_checkroot(struct super_block *sb,
        return "bitmap file not found.";
 }
 
-static int qnx4_fill_super(struct super_block *s, void *data, int silent)
+static int qnx4_fill_super(struct super_block *s, void *data, size_t data_size,
+                          int silent)
 {
        struct buffer_head *bh;
        struct inode *root;
@@ -383,9 +386,10 @@ static void destroy_inodecache(void)
 }
 
 static struct dentry *qnx4_mount(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data)
+       int flags, const char *dev_name, void *data, size_t data_size)
 {
-       return mount_bdev(fs_type, flags, dev_name, data, qnx4_fill_super);
+       return mount_bdev(fs_type, flags, dev_name, data, data_size,
+                         qnx4_fill_super);
 }
 
 static struct file_system_type qnx4_fs_type = {
index 4aeb26bcb4d029695226b15da569f8610b8f1585..a415c1b5f93685288e8367b97507c67b4949bca6 100644 (file)
@@ -30,7 +30,8 @@ static const struct super_operations qnx6_sops;
 static void qnx6_put_super(struct super_block *sb);
 static struct inode *qnx6_alloc_inode(struct super_block *sb);
 static void qnx6_destroy_inode(struct inode *inode);
-static int qnx6_remount(struct super_block *sb, int *flags, char *data);
+static int qnx6_remount(struct super_block *sb, int *flags,
+                       char *data, size_t data_size);
 static int qnx6_statfs(struct dentry *dentry, struct kstatfs *buf);
 static int qnx6_show_options(struct seq_file *seq, struct dentry *root);
 
@@ -53,7 +54,8 @@ static int qnx6_show_options(struct seq_file *seq, struct dentry *root)
        return 0;
 }
 
-static int qnx6_remount(struct super_block *sb, int *flags, char *data)
+static int qnx6_remount(struct super_block *sb, int *flags,
+                       char *data, size_t data_size)
 {
        sync_filesystem(sb);
        *flags |= SB_RDONLY;
@@ -294,7 +296,8 @@ static struct buffer_head *qnx6_check_first_superblock(struct super_block *s,
 static struct inode *qnx6_private_inode(struct super_block *s,
                                        struct qnx6_root_node *p);
 
-static int qnx6_fill_super(struct super_block *s, void *data, int silent)
+static int qnx6_fill_super(struct super_block *s, void *data, size_t data_size,
+                          int silent)
 {
        struct buffer_head *bh1 = NULL, *bh2 = NULL;
        struct qnx6_super_block *sb1 = NULL, *sb2 = NULL;
@@ -643,9 +646,10 @@ static void destroy_inodecache(void)
 }
 
 static struct dentry *qnx6_mount(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data)
+       int flags, const char *dev_name, void *data, size_t data_size)
 {
-       return mount_bdev(fs_type, flags, dev_name, data, qnx6_fill_super);
+       return mount_bdev(fs_type, flags, dev_name, data, data_size,
+                         qnx6_fill_super);
 }
 
 static struct file_system_type qnx6_fs_type = {
index 11201b2d06b927814215bbea7451540f4bb44fa3..2e9b23b4a98b301d0393eb981a8941c4b3f13379 100644 (file)
@@ -217,7 +217,7 @@ static int ramfs_parse_options(char *data, struct ramfs_mount_opts *opts)
        return 0;
 }
 
-int ramfs_fill_super(struct super_block *sb, void *data, int silent)
+int ramfs_fill_super(struct super_block *sb, void *data, size_t data_size, int silent)
 {
        struct ramfs_fs_info *fsi;
        struct inode *inode;
@@ -248,9 +248,9 @@ int ramfs_fill_super(struct super_block *sb, void *data, int silent)
 }
 
 struct dentry *ramfs_mount(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data)
+       int flags, const char *dev_name, void *data, size_t data_size)
 {
-       return mount_nodev(fs_type, flags, data, ramfs_fill_super);
+       return mount_nodev(fs_type, flags, data, data_size, ramfs_fill_super);
 }
 
 static void ramfs_kill_sb(struct super_block *sb)
index 1fc934d244592e2df6ee902e8606f39cd313055d..d8631cb384858bbdf58d392a671f0d2d4f3f2fa8 100644 (file)
@@ -61,7 +61,8 @@ static int is_any_reiserfs_magic_string(struct reiserfs_super_block *rs)
                is_reiserfs_jr(rs));
 }
 
-static int reiserfs_remount(struct super_block *s, int *flags, char *data);
+static int reiserfs_remount(struct super_block *s, int *flags,
+                           char *data, size_t data_size);
 static int reiserfs_statfs(struct dentry *dentry, struct kstatfs *buf);
 
 static int reiserfs_sync_fs(struct super_block *s, int wait)
@@ -1433,7 +1434,8 @@ static void handle_quota_files(struct super_block *s, char **qf_names,
 }
 #endif
 
-static int reiserfs_remount(struct super_block *s, int *mount_flags, char *arg)
+static int reiserfs_remount(struct super_block *s, int *mount_flags,
+                           char *arg, size_t data_size)
 {
        struct reiserfs_super_block *rs;
        struct reiserfs_transaction_handle th;
@@ -1898,7 +1900,8 @@ static int function2code(hashf_t func)
        if (!(silent))                          \
                reiserfs_warning(s, id, __VA_ARGS__)
 
-static int reiserfs_fill_super(struct super_block *s, void *data, int silent)
+static int reiserfs_fill_super(struct super_block *s, void *data, size_t data_size,
+                              int silent)
 {
        struct inode *root_inode;
        struct reiserfs_transaction_handle th;
@@ -2600,9 +2603,10 @@ out:
 
 static struct dentry *get_super_block(struct file_system_type *fs_type,
                           int flags, const char *dev_name,
-                          void *data)
+                          void *data, size_t data_size)
 {
-       return mount_bdev(fs_type, flags, dev_name, data, reiserfs_fill_super);
+       return mount_bdev(fs_type, flags, dev_name, data, data_size,
+                         reiserfs_fill_super);
 }
 
 static int __init init_reiserfs_fs(void)
index 6ccb51993a76b9d72bf76c843631b237f8cb4c43..a6a53403a035243e4dd7c90a67add9d984c9210e 100644 (file)
@@ -430,7 +430,8 @@ static int romfs_statfs(struct dentry *dentry, struct kstatfs *buf)
 /*
  * remounting must involve read-only
  */
-static int romfs_remount(struct super_block *sb, int *flags, char *data)
+static int romfs_remount(struct super_block *sb, int *flags,
+                        char *data, size_t data_size)
 {
        sync_filesystem(sb);
        *flags |= SB_RDONLY;
@@ -464,7 +465,8 @@ static __u32 romfs_checksum(const void *data, int size)
 /*
  * fill in the superblock
  */
-static int romfs_fill_super(struct super_block *sb, void *data, int silent)
+static int romfs_fill_super(struct super_block *sb, void *data, size_t data_size,
+                           int silent)
 {
        struct romfs_super_block *rsb;
        struct inode *root;
@@ -557,16 +559,17 @@ error_rsb:
  */
 static struct dentry *romfs_mount(struct file_system_type *fs_type,
                        int flags, const char *dev_name,
-                       void *data)
+                       void *data, size_t data_size)
 {
        struct dentry *ret = ERR_PTR(-EINVAL);
 
 #ifdef CONFIG_ROMFS_ON_MTD
-       ret = mount_mtd(fs_type, flags, dev_name, data, romfs_fill_super);
+       ret = mount_mtd(fs_type, flags, dev_name, data, data_size,
+                       romfs_fill_super);
 #endif
 #ifdef CONFIG_ROMFS_ON_BLOCK
        if (ret == ERR_PTR(-EINVAL))
-               ret = mount_bdev(fs_type, flags, dev_name, data,
+               ret = mount_bdev(fs_type, flags, dev_name, data, data_size,
                                  romfs_fill_super);
 #endif
        return ret;
index 40e657386fa52d9e0358ff45dd949dede645d4e0..6e27e56bd4f2e1fe93c94539f02e03a40cf20edc 100644 (file)
@@ -76,7 +76,8 @@ static const struct squashfs_decompressor *supported_squashfs_filesystem(short
 }
 
 
-static int squashfs_fill_super(struct super_block *sb, void *data, int silent)
+static int squashfs_fill_super(struct super_block *sb,
+                              void *data, size_t data_size, int silent)
 {
        struct squashfs_sb_info *msblk;
        struct squashfs_super_block *sblk = NULL;
@@ -371,7 +372,8 @@ static int squashfs_statfs(struct dentry *dentry, struct kstatfs *buf)
 }
 
 
-static int squashfs_remount(struct super_block *sb, int *flags, char *data)
+static int squashfs_remount(struct super_block *sb, int *flags,
+                           char *data, size_t data_size)
 {
        sync_filesystem(sb);
        *flags |= SB_RDONLY;
@@ -399,9 +401,11 @@ static void squashfs_put_super(struct super_block *sb)
 
 
 static struct dentry *squashfs_mount(struct file_system_type *fs_type,
-                               int flags, const char *dev_name, void *data)
+                                    int flags, const char *dev_name,
+                                    void *data, size_t data_size)
 {
-       return mount_bdev(fs_type, flags, dev_name, data, squashfs_fill_super);
+       return mount_bdev(fs_type, flags, dev_name, data, data_size,
+                         squashfs_fill_super);
 }
 
 
index f3a8c008e16430be1ba08d9f575c1df9faeb0f0a..3941f19828b4fff5945d538b3276c5cbd0108e38 100644 (file)
@@ -838,11 +838,13 @@ rescan:
  *     @sb:    superblock in question
  *     @sb_flags: revised superblock flags
  *     @data:  the rest of options
+ *     @data_size: The size of the data
  *      @force: whether or not to force the change
  *
  *     Alters the mount options of a mounted file system.
  */
-int do_remount_sb(struct super_block *sb, int sb_flags, void *data, int force)
+int do_remount_sb(struct super_block *sb, int sb_flags, void *data,
+                 size_t data_size, int force)
 {
        int retval;
        int remount_ro;
@@ -885,7 +887,7 @@ int do_remount_sb(struct super_block *sb, int sb_flags, void *data, int force)
        }
 
        if (sb->s_op->remount_fs) {
-               retval = sb->s_op->remount_fs(sb, &sb_flags, data);
+               retval = sb->s_op->remount_fs(sb, &sb_flags, data, data_size);
                if (retval) {
                        if (!force)
                                goto cancel_readonly;
@@ -924,7 +926,7 @@ static void do_emergency_remount_callback(struct super_block *sb)
                /*
                 * What lock protects sb->s_flags??
                 */
-               do_remount_sb(sb, SB_RDONLY, NULL, 1);
+               do_remount_sb(sb, SB_RDONLY, NULL, 0, 1);
        }
        up_write(&sb->s_umount);
 }
@@ -1054,8 +1056,9 @@ static int ns_set_super(struct super_block *sb, void *data)
 }
 
 struct dentry *mount_ns(struct file_system_type *fs_type,
-       int flags, void *data, void *ns, struct user_namespace *user_ns,
-       int (*fill_super)(struct super_block *, void *, int))
+       int flags, void *data, size_t data_size,
+       void *ns, struct user_namespace *user_ns,
+       int (*fill_super)(struct super_block *, void *, size_t, int))
 {
        struct super_block *sb;
 
@@ -1072,7 +1075,7 @@ struct dentry *mount_ns(struct file_system_type *fs_type,
 
        if (!sb->s_root) {
                int err;
-               err = fill_super(sb, data, flags & SB_SILENT ? 1 : 0);
+               err = fill_super(sb, data, data_size, flags & SB_SILENT ? 1 : 0);
                if (err) {
                        deactivate_locked_super(sb);
                        return ERR_PTR(err);
@@ -1102,8 +1105,8 @@ static int test_bdev_super(struct super_block *s, void *data)
 }
 
 struct dentry *mount_bdev(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data,
-       int (*fill_super)(struct super_block *, void *, int))
+       int flags, const char *dev_name, void *data, size_t data_size,
+       int (*fill_super)(struct super_block *, void *, size_t, int))
 {
        struct block_device *bdev;
        struct super_block *s;
@@ -1155,7 +1158,7 @@ struct dentry *mount_bdev(struct file_system_type *fs_type,
                s->s_mode = mode;
                snprintf(s->s_id, sizeof(s->s_id), "%pg", bdev);
                sb_set_blocksize(s, block_size(bdev));
-               error = fill_super(s, data, flags & SB_SILENT ? 1 : 0);
+               error = fill_super(s, data, data_size, flags & SB_SILENT ? 1 : 0);
                if (error) {
                        deactivate_locked_super(s);
                        goto error;
@@ -1192,8 +1195,8 @@ EXPORT_SYMBOL(kill_block_super);
 #endif
 
 struct dentry *mount_nodev(struct file_system_type *fs_type,
-       int flags, void *data,
-       int (*fill_super)(struct super_block *, void *, int))
+       int flags, void *data, size_t data_size,
+       int (*fill_super)(struct super_block *, void *, size_t, int))
 {
        int error;
        struct super_block *s = sget(fs_type, NULL, set_anon_super, flags, NULL);
@@ -1201,7 +1204,7 @@ struct dentry *mount_nodev(struct file_system_type *fs_type,
        if (IS_ERR(s))
                return ERR_CAST(s);
 
-       error = fill_super(s, data, flags & SB_SILENT ? 1 : 0);
+       error = fill_super(s, data, data_size, flags & SB_SILENT ? 1 : 0);
        if (error) {
                deactivate_locked_super(s);
                return ERR_PTR(error);
@@ -1217,8 +1220,8 @@ static int compare_single(struct super_block *s, void *p)
 }
 
 struct dentry *mount_single(struct file_system_type *fs_type,
-       int flags, void *data,
-       int (*fill_super)(struct super_block *, void *, int))
+       int flags, void *data, size_t data_size,
+       int (*fill_super)(struct super_block *, void *, size_t, int))
 {
        struct super_block *s;
        int error;
@@ -1227,21 +1230,22 @@ struct dentry *mount_single(struct file_system_type *fs_type,
        if (IS_ERR(s))
                return ERR_CAST(s);
        if (!s->s_root) {
-               error = fill_super(s, data, flags & SB_SILENT ? 1 : 0);
+               error = fill_super(s, data, data_size, flags & SB_SILENT ? 1 : 0);
                if (error) {
                        deactivate_locked_super(s);
                        return ERR_PTR(error);
                }
                s->s_flags |= SB_ACTIVE;
        } else {
-               do_remount_sb(s, flags, data, 0);
+               do_remount_sb(s, flags, data, data_size, 0);
        }
        return dget(s->s_root);
 }
 EXPORT_SYMBOL(mount_single);
 
 struct dentry *
-mount_fs(struct file_system_type *type, int flags, const char *name, void *data)
+mount_fs(struct file_system_type *type, int flags, const char *name,
+        void *data, size_t data_size)
 {
        struct dentry *root;
        struct super_block *sb;
@@ -1253,12 +1257,12 @@ mount_fs(struct file_system_type *type, int flags, const char *name, void *data)
                if (!secdata)
                        goto out;
 
-               error = security_sb_copy_data(data, secdata);
+               error = security_sb_copy_data(data, data_size, secdata);
                if (error)
                        goto out_free_secdata;
        }
 
-       root = type->mount(type, flags, name, data);
+       root = type->mount(type, flags, name, data, data_size);
        if (IS_ERR(root)) {
                error = PTR_ERR(root);
                goto out_free_secdata;
@@ -1276,7 +1280,7 @@ mount_fs(struct file_system_type *type, int flags, const char *name, void *data)
        smp_wmb();
        sb->s_flags |= SB_BORN;
 
-       error = security_sb_kern_mount(sb, flags, secdata);
+       error = security_sb_kern_mount(sb, flags, secdata, data_size);
        if (error)
                goto out_sb;
 
index 92682fcc41f6c976f1d38cf3111eab509a9028d8..77302c35b0ff440d734d82f701c0066cc65972ba 100644 (file)
@@ -21,7 +21,7 @@ static struct kernfs_root *sysfs_root;
 struct kernfs_node *sysfs_root_kn;
 
 static struct dentry *sysfs_mount(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data)
+       int flags, const char *dev_name, void *data, size_t data_size)
 {
        struct dentry *root;
        void *ns;
index 499a20a5a0107f3ca8942485a7a5b3bc58737793..e8927ea70d12caf60b70a47a265a99625e240b32 100644 (file)
@@ -57,7 +57,8 @@ static int sysv_sync_fs(struct super_block *sb, int wait)
        return 0;
 }
 
-static int sysv_remount(struct super_block *sb, int *flags, char *data)
+static int sysv_remount(struct super_block *sb, int *flags,
+                       char *data, size_t data_size)
 {
        struct sysv_sb_info *sbi = SYSV_SB(sb);
 
index 89765ddfb738c075b44003e0e1dfeea414d24c7f..275c7038eecd13d1de0afeb1123d877485e0b429 100644 (file)
@@ -349,7 +349,8 @@ static int complete_read_super(struct super_block *sb, int silent, int size)
        return 1;
 }
 
-static int sysv_fill_super(struct super_block *sb, void *data, int silent)
+static int sysv_fill_super(struct super_block *sb, void *data, size_t data_size,
+                          int silent)
 {
        struct buffer_head *bh1, *bh = NULL;
        struct sysv_sb_info *sbi;
@@ -470,7 +471,8 @@ static int v7_sanity_check(struct super_block *sb, struct buffer_head *bh)
        return 1;
 }
 
-static int v7_fill_super(struct super_block *sb, void *data, int silent)
+static int v7_fill_super(struct super_block *sb, void *data, size_t data_size,
+                        int silent)
 {
        struct sysv_sb_info *sbi;
        struct buffer_head *bh;
@@ -528,15 +530,17 @@ failed:
 /* Every kernel module contains stuff like this. */
 
 static struct dentry *sysv_mount(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data)
+       int flags, const char *dev_name, void *data, size_t data_size)
 {
-       return mount_bdev(fs_type, flags, dev_name, data, sysv_fill_super);
+       return mount_bdev(fs_type, flags, dev_name, data, data_size,
+                         sysv_fill_super);
 }
 
 static struct dentry *v7_mount(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data)
+       int flags, const char *dev_name, void *data, size_t data_size)
 {
-       return mount_bdev(fs_type, flags, dev_name, data, v7_fill_super);
+       return mount_bdev(fs_type, flags, dev_name, data, data_size,
+                         v7_fill_super);
 }
 
 static struct file_system_type sysv_fs_type = {
index 7098c49f36934ec5859808313d6b803befc1ab22..aa423e44676536838853e6cb484a925f005e3159 100644 (file)
@@ -225,7 +225,8 @@ static int tracefs_apply_options(struct super_block *sb)
        return 0;
 }
 
-static int tracefs_remount(struct super_block *sb, int *flags, char *data)
+static int tracefs_remount(struct super_block *sb, int *flags,
+                          char *data, size_t data_size)
 {
        int err;
        struct tracefs_fs_info *fsi = sb->s_fs_info;
@@ -264,7 +265,8 @@ static const struct super_operations tracefs_super_operations = {
        .show_options   = tracefs_show_options,
 };
 
-static int trace_fill_super(struct super_block *sb, void *data, int silent)
+static int trace_fill_super(struct super_block *sb,
+                           void *data, size_t data_size, int silent)
 {
        static const struct tree_descr trace_files[] = {{""}};
        struct tracefs_fs_info *fsi;
@@ -299,9 +301,9 @@ fail:
 
 static struct dentry *trace_mount(struct file_system_type *fs_type,
                        int flags, const char *dev_name,
-                       void *data)
+                       void *data, size_t data_size)
 {
-       return mount_single(fs_type, flags, data, trace_fill_super);
+       return mount_single(fs_type, flags, data, data_size, trace_fill_super);
 }
 
 static struct file_system_type trace_fs_type = {
index 23e7042666a755dd361720e3a29b1a56585fee33..728ecc99f330b754bac6d483543ae2bc2545201d 100644 (file)
@@ -1868,7 +1868,8 @@ static void ubifs_put_super(struct super_block *sb)
        mutex_unlock(&c->umount_mutex);
 }
 
-static int ubifs_remount_fs(struct super_block *sb, int *flags, char *data)
+static int ubifs_remount_fs(struct super_block *sb, int *flags,
+                           char *data, size_t data_size)
 {
        int err;
        struct ubifs_info *c = sb->s_fs_info;
@@ -2134,7 +2135,7 @@ static int sb_set(struct super_block *sb, void *data)
 }
 
 static struct dentry *ubifs_mount(struct file_system_type *fs_type, int flags,
-                       const char *name, void *data)
+                       const char *name, void *data, size_t data_size)
 {
        struct ubi_volume_desc *ubi;
        struct ubifs_info *c;
index 6f515651a2c2fe3817c763e3d77d351509a862d9..21c21a7fb57884bcc027605014557b9312dc434f 100644 (file)
@@ -87,10 +87,10 @@ enum {
 enum { UDF_MAX_LINKS = 0xffff };
 
 /* These are the "meat" - everything else is stuffing */
-static int udf_fill_super(struct super_block *, void *, int);
+static int udf_fill_super(struct super_block *, void *, size_t, int);
 static void udf_put_super(struct super_block *);
 static int udf_sync_fs(struct super_block *, int);
-static int udf_remount_fs(struct super_block *, int *, char *);
+static int udf_remount_fs(struct super_block *, int *, char *, size_t);
 static void udf_load_logicalvolint(struct super_block *, struct kernel_extent_ad);
 static int udf_find_fileset(struct super_block *, struct kernel_lb_addr *,
                            struct kernel_lb_addr *);
@@ -126,9 +126,11 @@ struct logicalVolIntegrityDescImpUse *udf_sb_lvidiu(struct super_block *sb)
 
 /* UDF filesystem type */
 static struct dentry *udf_mount(struct file_system_type *fs_type,
-                     int flags, const char *dev_name, void *data)
+                               int flags, const char *dev_name,
+                               void *data, size_t data_size)
 {
-       return mount_bdev(fs_type, flags, dev_name, data, udf_fill_super);
+       return mount_bdev(fs_type, flags, dev_name, data, data_size,
+                         udf_fill_super);
 }
 
 static struct file_system_type udf_fstype = {
@@ -608,7 +610,8 @@ static int udf_parse_options(char *options, struct udf_options *uopt,
        return 1;
 }
 
-static int udf_remount_fs(struct super_block *sb, int *flags, char *options)
+static int udf_remount_fs(struct super_block *sb, int *flags,
+                         char *options, size_t data_size)
 {
        struct udf_options uopt;
        struct udf_sb_info *sbi = UDF_SB(sb);
@@ -2032,7 +2035,8 @@ u64 lvid_get_unique_id(struct super_block *sb)
        return ret;
 }
 
-static int udf_fill_super(struct super_block *sb, void *options, int silent)
+static int udf_fill_super(struct super_block *sb,
+                         void *options, size_t data_size, int silent)
 {
        int ret = -EINVAL;
        struct inode *inode = NULL;
index a4e07e910f1b4c7d679645c2d3941c8e19f75ee4..f48a5b802221527f9bab5e73489251008f147cdf 100644 (file)
@@ -774,7 +774,8 @@ static u64 ufs_max_bytes(struct super_block *sb)
        return res << uspi->s_bshift;
 }
 
-static int ufs_fill_super(struct super_block *sb, void *data, int silent)
+static int ufs_fill_super(struct super_block *sb, void *data, size_t data_size,
+                         int silent)
 {
        struct ufs_sb_info * sbi;
        struct ufs_sb_private_info * uspi;
@@ -1297,7 +1298,8 @@ failed_nomem:
        return -ENOMEM;
 }
 
-static int ufs_remount (struct super_block *sb, int *mount_flags, char *data)
+static int ufs_remount (struct super_block *sb, int *mount_flags,
+                       char *data, size_t data_size)
 {
        struct ufs_sb_private_info * uspi;
        struct ufs_super_block_first * usb1;
@@ -1505,9 +1507,10 @@ static const struct super_operations ufs_super_ops = {
 };
 
 static struct dentry *ufs_mount(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data)
+       int flags, const char *dev_name, void *data, size_t data_size)
 {
-       return mount_bdev(fs_type, flags, dev_name, data, ufs_fill_super);
+       return mount_bdev(fs_type, flags, dev_name, data, data_size,
+                         ufs_fill_super);
 }
 
 static struct file_system_type ufs_fs_type = {
index 207ee302b1bb9f4039b8963b7ae1a68ce8ac8487..9e2ce4cd98e104016bebafd70b0c72b70ffa6932 100644 (file)
@@ -1238,7 +1238,8 @@ STATIC int
 xfs_fs_remount(
        struct super_block      *sb,
        int                     *flags,
-       char                    *options)
+       char                    *options,
+       size_t                  data_size)
 {
        struct xfs_mount        *mp = XFS_M(sb);
        xfs_sb_t                *sbp = &mp->m_sb;
@@ -1569,6 +1570,7 @@ STATIC int
 xfs_fs_fill_super(
        struct super_block      *sb,
        void                    *data,
+       size_t                  data_size,
        int                     silent)
 {
        struct inode            *root;
@@ -1782,9 +1784,11 @@ xfs_fs_mount(
        struct file_system_type *fs_type,
        int                     flags,
        const char              *dev_name,
-       void                    *data)
+       void                    *data,
+       size_t                  data_size)
 {
-       return mount_bdev(fs_type, flags, dev_name, data, xfs_fs_fill_super);
+       return mount_bdev(fs_type, flags, dev_name, data, data_size,
+                         xfs_fs_fill_super);
 }
 
 static long
index 3b0ba54cc4d5b0ea9bc7a11d48b476b48e9e9e22..a02de1b397ca6a4486476787295839e493e83c03 100644 (file)
@@ -75,11 +75,11 @@ struct dentry *debugfs_create_dir(const char *name, struct dentry *parent);
 struct dentry *debugfs_create_symlink(const char *name, struct dentry *parent,
                                      const char *dest);
 
-typedef struct vfsmount *(*debugfs_automount_t)(struct dentry *, void *);
+typedef struct vfsmount *(*debugfs_automount_t)(struct dentry *, void *, size_t);
 struct dentry *debugfs_create_automount(const char *name,
                                        struct dentry *parent,
                                        debugfs_automount_t f,
-                                       void *data);
+                                       void *data, size_t data_size);
 
 void debugfs_remove(struct dentry *dentry);
 void debugfs_remove_recursive(struct dentry *dentry);
@@ -204,8 +204,8 @@ static inline struct dentry *debugfs_create_symlink(const char *name,
 
 static inline struct dentry *debugfs_create_automount(const char *name,
                                        struct dentry *parent,
-                                       struct vfsmount *(*f)(void *),
-                                       void *data)
+                                       struct vfsmount *(*f)(void *, size_t),
+                                       void *data, size_t data_size)
 {
        return ERR_PTR(-ENODEV);
 }
index 33322702c910b9cb879d05a03c070c51487c0d26..4323b8fe353d146be9a7cdf77910325ce144c7ee 100644 (file)
@@ -1854,7 +1854,7 @@ struct super_operations {
        int (*thaw_super) (struct super_block *);
        int (*unfreeze_fs) (struct super_block *);
        int (*statfs) (struct dentry *, struct kstatfs *);
-       int (*remount_fs) (struct super_block *, int *, char *);
+       int (*remount_fs) (struct super_block *, int *, char *, size_t);
        void (*umount_begin) (struct super_block *);
 
        int (*show_options)(struct seq_file *, struct dentry *);
@@ -2116,7 +2116,7 @@ struct file_system_type {
 #define FS_USERNS_MOUNT                8       /* Can be mounted by userns root */
 #define FS_RENAME_DOES_D_MOVE  32768   /* FS will handle d_move() during rename() internally. */
        struct dentry *(*mount) (struct file_system_type *, int,
-                      const char *, void *);
+                                const char *, void *, size_t);
        void (*kill_sb) (struct super_block *);
        struct module *owner;
        struct file_system_type * next;
@@ -2135,26 +2135,27 @@ struct file_system_type {
 #define MODULE_ALIAS_FS(NAME) MODULE_ALIAS("fs-" NAME)
 
 extern struct dentry *mount_ns(struct file_system_type *fs_type,
-       int flags, void *data, void *ns, struct user_namespace *user_ns,
-       int (*fill_super)(struct super_block *, void *, int));
+       int flags, void *data, size_t data_size,
+       void *ns, struct user_namespace *user_ns,
+       int (*fill_super)(struct super_block *, void *, size_t, int));
 #ifdef CONFIG_BLOCK
 extern struct dentry *mount_bdev(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data,
-       int (*fill_super)(struct super_block *, void *, int));
+       int flags, const char *dev_name, void *data, size_t data_size,
+       int (*fill_super)(struct super_block *, void *, size_t, int));
 #else
 static inline struct dentry *mount_bdev(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data,
-       int (*fill_super)(struct super_block *, void *, int))
+       int flags, const char *dev_name, void *data, size_t data_size,
+       int (*fill_super)(struct super_block *, void *, size_t, int))
 {
        return ERR_PTR(-ENODEV);
 }
 #endif
 extern struct dentry *mount_single(struct file_system_type *fs_type,
-       int flags, void *data,
-       int (*fill_super)(struct super_block *, void *, int));
+       int flags, void *data, size_t data_size,
+       int (*fill_super)(struct super_block *, void *, size_t, int));
 extern struct dentry *mount_nodev(struct file_system_type *fs_type,
-       int flags, void *data,
-       int (*fill_super)(struct super_block *, void *, int));
+       int flags, void *data, size_t data_size,
+       int (*fill_super)(struct super_block *, void *, size_t, int));
 extern struct dentry *mount_subtree(struct vfsmount *mnt, const char *path);
 void generic_shutdown_super(struct super_block *sb);
 #ifdef CONFIG_BLOCK
@@ -2214,8 +2215,8 @@ mount_pseudo(struct file_system_type *fs_type, char *name,
 
 extern int register_filesystem(struct file_system_type *);
 extern int unregister_filesystem(struct file_system_type *);
-extern struct vfsmount *kern_mount_data(struct file_system_type *, void *data);
-#define kern_mount(type) kern_mount_data(type, NULL)
+extern struct vfsmount *kern_mount_data(struct file_system_type *, void *, size_t);
+#define kern_mount(type) kern_mount_data(type, NULL, 0)
 extern void kern_unmount(struct vfsmount *mnt);
 extern int may_umount_tree(struct vfsmount *);
 extern int may_umount(struct vfsmount *);
index 97a020c616ad1f693507e256cece8ef1ab81d87d..8a44075347acf45a2b2fcc3b466714b2170f0615 100644 (file)
  *     @type contains the filesystem type.
  *     @flags contains the mount flags.
  *     @data contains the filesystem-specific data.
+ *     @data_size contains the size of the data.
  *     Return 0 if permission is granted.
  * @sb_copy_data:
  *     Allow mount option data to be copied prior to parsing by the filesystem,
  *     specific options to avoid having to make filesystems aware of them.
  *     @type the type of filesystem being mounted.
  *     @orig the original mount data copied from userspace.
+ *     @orig_data is the size of the original data
  *     @copy copied data which will be passed to the security module.
  *     Returns 0 if the copy was successful.
  * @sb_remount:
  *     are being made to those options.
  *     @sb superblock being remounted
  *     @data contains the filesystem-specific data.
+ *     @data_size contains the size of the data.
  *     Return 0 if permission is granted.
  * @sb_umount:
  *     Check permission before the @mnt file system is unmounted.
@@ -1461,13 +1464,15 @@ union security_list_options {
 
        int (*sb_alloc_security)(struct super_block *sb);
        void (*sb_free_security)(struct super_block *sb);
-       int (*sb_copy_data)(char *orig, char *copy);
-       int (*sb_remount)(struct super_block *sb, void *data);
-       int (*sb_kern_mount)(struct super_block *sb, int flags, void *data);
+       int (*sb_copy_data)(char *orig, size_t orig_size, char *copy);
+       int (*sb_remount)(struct super_block *sb, void *data, size_t data_size);
+       int (*sb_kern_mount)(struct super_block *sb, int flags,
+                            void *data, size_t data_size);
        int (*sb_show_options)(struct seq_file *m, struct super_block *sb);
        int (*sb_statfs)(struct dentry *dentry);
        int (*sb_mount)(const char *dev_name, const struct path *path,
-                       const char *type, unsigned long flags, void *data);
+                       const char *type, unsigned long flags,
+                       void *data, size_t data_size);
        int (*sb_umount)(struct vfsmount *mnt, int flags);
        int (*sb_pivotroot)(const struct path *old_path, const struct path *new_path);
        int (*sb_set_mnt_opts)(struct super_block *sb,
index 45b1f56c6c2f9fb0db10fc912251955af04fc05e..8a1031a511c9dbdd64305f4036ecab086f96c2a9 100644 (file)
@@ -90,10 +90,11 @@ extern struct vfsmount *clone_private_mount(const struct path *path);
 struct file_system_type;
 extern struct vfsmount *vfs_kern_mount(struct file_system_type *type,
                                      int flags, const char *name,
-                                     void *data);
+                                     void *data, size_t data_size);
 extern struct vfsmount *vfs_submount(const struct dentry *mountpoint,
                                     struct file_system_type *type,
-                                    const char *name, void *data);
+                                    const char *name,
+                                    void *data, size_t data_size);
 
 extern void mnt_set_expiry(struct vfsmount *mnt, struct list_head *expiry_list);
 extern void mark_mounts_for_expiry(struct list_head *mounts);
index f456230f9330b0c5bef26a4010e8f524eb38dbc2..3f37c7cd711c2e385b82e69ecd32ae750eff38b8 100644 (file)
@@ -19,8 +19,8 @@
 #include <linux/mount.h>
 
 extern struct dentry *mount_mtd(struct file_system_type *fs_type, int flags,
-                     const char *dev_name, void *data,
-                     int (*fill_super)(struct super_block *, void *, int));
+                     const char *dev_name, void *data, size_t data_size,
+                     int (*fill_super)(struct super_block *, void *, size_t, int));
 extern void kill_mtd_super(struct super_block *sb);
 
 
index 5ef7d54caac23ecd957145a407cb95f29542d109..6d64e6be9928d9a4c1e0f37c8020dbd89d6cdff5 100644 (file)
@@ -5,7 +5,7 @@
 struct inode *ramfs_get_inode(struct super_block *sb, const struct inode *dir,
         umode_t mode, dev_t dev);
 extern struct dentry *ramfs_mount(struct file_system_type *fs_type,
-        int flags, const char *dev_name, void *data);
+        int flags, const char *dev_name, void *data, size_t data_size);
 
 #ifdef CONFIG_MMU
 static inline int
@@ -21,6 +21,6 @@ extern const struct file_operations ramfs_file_operations;
 extern const struct vm_operations_struct generic_file_vm_ops;
 extern int __init init_ramfs_fs(void);
 
-int ramfs_fill_super(struct super_block *sb, void *data, int silent);
+int ramfs_fill_super(struct super_block *sb, void *data, size_t data_size, int silent);
 
 #endif
index 75f4156c84d7d251cfc5a041a7a149b1d7588680..30a3db9f284b317af48ff028429fb33bdfc828c9 100644 (file)
@@ -248,13 +248,13 @@ void security_bprm_committing_creds(struct linux_binprm *bprm);
 void security_bprm_committed_creds(struct linux_binprm *bprm);
 int security_sb_alloc(struct super_block *sb);
 void security_sb_free(struct super_block *sb);
-int security_sb_copy_data(char *orig, char *copy);
-int security_sb_remount(struct super_block *sb, void *data);
-int security_sb_kern_mount(struct super_block *sb, int flags, void *data);
+int security_sb_copy_data(char *orig, size_t orig_size, char *copy);
+int security_sb_remount(struct super_block *sb, void *data, size_t data_size);
+int security_sb_kern_mount(struct super_block *sb, int flags, void *data, size_t data_size);
 int security_sb_show_options(struct seq_file *m, struct super_block *sb);
 int security_sb_statfs(struct dentry *dentry);
 int security_sb_mount(const char *dev_name, const struct path *path,
-                     const char *type, unsigned long flags, void *data);
+                     const char *type, unsigned long flags, void *data, size_t data_size);
 int security_sb_umount(struct vfsmount *mnt, int flags);
 int security_sb_pivotroot(const struct path *old_path, const struct path *new_path);
 int security_sb_set_mnt_opts(struct super_block *sb,
@@ -555,17 +555,18 @@ static inline int security_sb_alloc(struct super_block *sb)
 static inline void security_sb_free(struct super_block *sb)
 { }
 
-static inline int security_sb_copy_data(char *orig, char *copy)
+static inline int security_sb_copy_data(char *orig, size_t orig_size, char *copy)
 {
        return 0;
 }
 
-static inline int security_sb_remount(struct super_block *sb, void *data)
+static inline int security_sb_remount(struct super_block *sb, void *data, size_t data_size)
 {
        return 0;
 }
 
-static inline int security_sb_kern_mount(struct super_block *sb, int flags, void *data)
+static inline int security_sb_kern_mount(struct super_block *sb, int flags,
+                                        void *data, size_t data_size)
 {
        return 0;
 }
@@ -583,7 +584,7 @@ static inline int security_sb_statfs(struct dentry *dentry)
 
 static inline int security_sb_mount(const char *dev_name, const struct path *path,
                                    const char *type, unsigned long flags,
-                                   void *data)
+                                   void *data, size_t data_size)
 {
        return 0;
 }
index f155dc607112e14420fb0eaf2865fb73b270f886..66772728cb7447910ff5d8115fa78005250170a0 100644 (file)
@@ -49,7 +49,8 @@ static inline struct shmem_inode_info *SHMEM_I(struct inode *inode)
  * Functions in mm/shmem.c called directly from elsewhere:
  */
 extern int shmem_init(void);
-extern int shmem_fill_super(struct super_block *sb, void *data, int silent);
+extern int shmem_fill_super(struct super_block *sb, void *data, size_t data_size,
+                           int silent);
 extern struct file *shmem_file_setup(const char *name,
                                        loff_t size, unsigned long flags);
 extern struct file *shmem_kernel_file_setup(const char *name, loff_t size,
index e1c9afa9d8c9103fa1463a45a425c9468e4c1628..d512dd615682591351fcd090d39843d08fdececd 100644 (file)
@@ -595,7 +595,7 @@ out:
 
 static bool is_tmpfs;
 static struct dentry *rootfs_mount(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data)
+       int flags, const char *dev_name, void *data, size_t data_size)
 {
        static unsigned long once;
        void *fill = ramfs_fill_super;
@@ -606,7 +606,7 @@ static struct dentry *rootfs_mount(struct file_system_type *fs_type,
        if (IS_ENABLED(CONFIG_TMPFS) && is_tmpfs)
                fill = shmem_fill_super;
 
-       return mount_nodev(fs_type, flags, data, fill);
+       return mount_nodev(fs_type, flags, data, data_size, fill);
 }
 
 static struct file_system_type rootfs_fs_type = {
index c0d58f390c3b43342a6c0fe53c6fd8e0d5ebb391..4671d215cb840b9e40533cc2efb2f14e02dd7048 100644 (file)
@@ -322,7 +322,7 @@ err:
        return ERR_PTR(ret);
 }
 
-static int mqueue_fill_super(struct super_block *sb, void *data, int silent)
+static int mqueue_fill_super(struct super_block *sb, void *data, size_t data_size, int silent)
 {
        struct inode *inode;
        struct ipc_namespace *ns = sb->s_fs_info;
@@ -345,7 +345,7 @@ static int mqueue_fill_super(struct super_block *sb, void *data, int silent)
 
 static struct dentry *mqueue_mount(struct file_system_type *fs_type,
                         int flags, const char *dev_name,
-                        void *data)
+                        void *data, size_t data_size)
 {
        struct ipc_namespace *ns;
        if (flags & SB_KERNMOUNT) {
@@ -354,7 +354,8 @@ static struct dentry *mqueue_mount(struct file_system_type *fs_type,
        } else {
                ns = current->nsproxy->ipc_ns;
        }
-       return mount_ns(fs_type, flags, data, ns, ns->user_ns, mqueue_fill_super);
+       return mount_ns(fs_type, flags, data, data_size, ns, ns->user_ns,
+                       mqueue_fill_super);
 }
 
 static void init_once(void *foo)
@@ -1538,7 +1539,7 @@ int mq_init_ns(struct ipc_namespace *ns)
        ns->mq_msg_default   = DFLT_MSG;
        ns->mq_msgsize_default  = DFLT_MSGSIZE;
 
-       ns->mq_mnt = kern_mount_data(&mqueue_fs_type, ns);
+       ns->mq_mnt = kern_mount_data(&mqueue_fs_type, ns, 0);
        if (IS_ERR(ns->mq_mnt)) {
                int err = PTR_ERR(ns->mq_mnt);
                ns->mq_mnt = NULL;
index 2ada5e21dfa62175d6cf9667ed4636e4c4ada659..f4aad0b704de1519bed73b8565eba6b3568fa15f 100644 (file)
@@ -629,7 +629,7 @@ static int bpf_parse_options(char *data, struct bpf_mount_opts *opts)
        return 0;
 }
 
-static int bpf_fill_super(struct super_block *sb, void *data, int silent)
+static int bpf_fill_super(struct super_block *sb, void *data, size_t data_size, int silent)
 {
        static const struct tree_descr bpf_rfiles[] = { { "" } };
        struct bpf_mount_opts opts;
@@ -655,9 +655,10 @@ static int bpf_fill_super(struct super_block *sb, void *data, int silent)
 }
 
 static struct dentry *bpf_mount(struct file_system_type *type, int flags,
-                               const char *dev_name, void *data)
+                               const char *dev_name, void *data,
+                               size_t data_size)
 {
-       return mount_nodev(type, flags, data, bpf_fill_super);
+       return mount_nodev(type, flags, data, data_size, bpf_fill_super);
 }
 
 static struct file_system_type bpf_fs_type = {
index aae10baf1902af2099292856bf2e299f14edfd1f..48dbf249bec53a5df992fca2b23c57ff5c4f56f4 100644 (file)
@@ -2031,7 +2031,7 @@ struct dentry *cgroup_do_mount(struct file_system_type *fs_type, int flags,
 
 static struct dentry *cgroup_mount(struct file_system_type *fs_type,
                         int flags, const char *unused_dev_name,
-                        void *data)
+                        void *data, size_t data_size)
 {
        struct cgroup_namespace *ns = current->nsproxy->cgroup_ns;
        struct dentry *dentry;
index 266f10cb7222b558aca0a777206d7bc747912750..6d9f1a709af9daa62e042ae9942c65f3b48ea312 100644 (file)
@@ -316,7 +316,8 @@ static inline bool is_in_v2_mode(void)
  * silently switch it to mount "cgroup" instead
  */
 static struct dentry *cpuset_mount(struct file_system_type *fs_type,
-                        int flags, const char *unused_dev_name, void *data)
+                                  int flags, const char *unused_dev_name,
+                                  void *data, size_t data_size)
 {
        struct file_system_type *cgroup_fs = get_fs_type("cgroup");
        struct dentry *ret = ERR_PTR(-ENODEV);
@@ -324,8 +325,8 @@ static struct dentry *cpuset_mount(struct file_system_type *fs_type,
                char mountopts[] =
                        "cpuset,noprefix,"
                        "release_agent=/sbin/cpuset_release_agent";
-               ret = cgroup_fs->mount(cgroup_fs, flags,
-                                          unused_dev_name, mountopts);
+               ret = cgroup_fs->mount(cgroup_fs, flags, unused_dev_name,
+                                      mountopts, data_size);
                put_filesystem(cgroup_fs);
        }
        return ret;
index bf6f1d70484dc02a449fa71b73b753649b698715..4bfa31886ba42a96e651fd61a45bf4f7c287416c 100644 (file)
@@ -7985,7 +7985,8 @@ init_tracer_tracefs(struct trace_array *tr, struct dentry *d_tracer)
        ftrace_init_tracefs(tr, d_tracer);
 }
 
-static struct vfsmount *trace_automount(struct dentry *mntpt, void *ingore)
+static struct vfsmount *trace_automount(struct dentry *mntpt,
+                                       void *data, size_t data_size)
 {
        struct vfsmount *mnt;
        struct file_system_type *type;
@@ -7998,7 +7999,7 @@ static struct vfsmount *trace_automount(struct dentry *mntpt, void *ingore)
        type = get_fs_type("tracefs");
        if (!type)
                return NULL;
-       mnt = vfs_submount(mntpt, type, "tracefs", NULL);
+       mnt = vfs_submount(mntpt, type, "tracefs", NULL, 0);
        put_filesystem(type);
        if (IS_ERR(mnt))
                return NULL;
@@ -8034,7 +8035,7 @@ struct dentry *tracing_init_dentry(void)
         * work with the newer kerenl.
         */
        tr->dir = debugfs_create_automount("tracing", NULL,
-                                          trace_automount, NULL);
+                                          trace_automount, NULL, 0);
        if (!tr->dir) {
                pr_warn_once("Could not create debugfs directory 'tracing'\n");
                return ERR_PTR(-ENOMEM);
index 0376c124b043be4d9be9f9fc233c3e03092ce428..47bb74fc97fb5fcdb9f18fa17e4d20cf7c37403c 100644 (file)
@@ -3394,7 +3394,8 @@ error:
 
 }
 
-static int shmem_remount_fs(struct super_block *sb, int *flags, char *data)
+static int shmem_remount_fs(struct super_block *sb, int *flags,
+                           char *data, size_t data_size)
 {
        struct shmem_sb_info *sbinfo = SHMEM_SB(sb);
        struct shmem_sb_info config = *sbinfo;
@@ -3477,7 +3478,8 @@ static void shmem_put_super(struct super_block *sb)
        sb->s_fs_info = NULL;
 }
 
-int shmem_fill_super(struct super_block *sb, void *data, int silent)
+int shmem_fill_super(struct super_block *sb, void *data, size_t data_size,
+                    int silent)
 {
        struct inode *inode;
        struct shmem_sb_info *sbinfo;
@@ -3691,9 +3693,9 @@ static const struct vm_operations_struct shmem_vm_ops = {
 };
 
 static struct dentry *shmem_mount(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data)
+       int flags, const char *dev_name, void *data, size_t data_size)
 {
-       return mount_nodev(fs_type, flags, data, shmem_fill_super);
+       return mount_nodev(fs_type, flags, data, data_size, shmem_fill_super);
 }
 
 static struct file_system_type shmem_fs_type = {
index 9da65552e7ca72b89397a38c2b7347e3bdfbf030..58886d40786b4fdfcc8a68ea32d8827d2fdddcee 100644 (file)
@@ -1815,7 +1815,8 @@ static void lock_zspage(struct zspage *zspage)
 }
 
 static struct dentry *zs_mount(struct file_system_type *fs_type,
-                               int flags, const char *dev_name, void *data)
+                              int flags, const char *dev_name,
+                              void *data, size_t data_size)
 {
        static const struct dentry_operations ops = {
                .d_dname = simple_dname,
index e6945e318f0285441c0095903e099cb272fa78ec..391a0da49ffe9e2f06991d21843bc2a202652c54 100644 (file)
@@ -352,7 +352,8 @@ static const struct xattr_handler *sockfs_xattr_handlers[] = {
 };
 
 static struct dentry *sockfs_mount(struct file_system_type *fs_type,
-                        int flags, const char *dev_name, void *data)
+                                  int flags, const char *dev_name,
+                                  void *data, size_t data_size)
 {
        return mount_pseudo_xattr(fs_type, "socket:", &sockfs_ops,
                                  sockfs_xattr_handlers,
index 4fda18d47e2c1ded7dbb8ddfb85cb189bf5d4b0c..023c2a6389e7d3e235bfd0a67e95b149b1881cd7 100644 (file)
@@ -1367,7 +1367,7 @@ rpc_gssd_dummy_depopulate(struct dentry *pipe_dentry)
 }
 
 static int
-rpc_fill_super(struct super_block *sb, void *data, int silent)
+rpc_fill_super(struct super_block *sb, void *data, size_t data_size, int silent)
 {
        struct inode *inode;
        struct dentry *root, *gssd_dentry;
@@ -1430,10 +1430,11 @@ EXPORT_SYMBOL_GPL(gssd_running);
 
 static struct dentry *
 rpc_mount(struct file_system_type *fs_type,
-               int flags, const char *dev_name, void *data)
+         int flags, const char *dev_name, void *data, size_t data_size)
 {
        struct net *net = current->nsproxy->net_ns;
-       return mount_ns(fs_type, flags, data, net, net->user_ns, rpc_fill_super);
+       return mount_ns(fs_type, flags, data, data_size,
+                       net, net->user_ns, rpc_fill_super);
 }
 
 static void rpc_kill_sb(struct super_block *sb)
index e09fe4d7307cd02f85919aefccacc19276e96be9..658b85639006e58bc6c6fdb23db79b979af20f1e 100644 (file)
@@ -137,7 +137,8 @@ static const struct super_operations aafs_super_ops = {
        .show_path = aafs_show_path,
 };
 
-static int fill_super(struct super_block *sb, void *data, int silent)
+static int fill_super(struct super_block *sb, void *data, size_t data_size,
+                     int silent)
 {
        static struct tree_descr files[] = { {""} };
        int error;
@@ -151,9 +152,10 @@ static int fill_super(struct super_block *sb, void *data, int silent)
 }
 
 static struct dentry *aafs_mount(struct file_system_type *fs_type,
-                                int flags, const char *dev_name, void *data)
+                                int flags, const char *dev_name, void *data,
+                                size_t data_size)
 {
-       return mount_single(fs_type, flags, data, fill_super);
+       return mount_single(fs_type, flags, data, data_size, fill_super);
 }
 
 static struct file_system_type aafs_ops = {
index 8b8b70620bbe753e35db3fe5e679334dab8ebb83..a7bb2f5377f73837c1a60cb8710e6bf30513b08e 100644 (file)
@@ -520,7 +520,8 @@ static int apparmor_file_mprotect(struct vm_area_struct *vma,
 }
 
 static int apparmor_sb_mount(const char *dev_name, const struct path *path,
-                            const char *type, unsigned long flags, void *data)
+                            const char *type, unsigned long flags,
+                            void *data, size_t data_size)
 {
        struct aa_label *label;
        int error = 0;
index 8dd9ca8848e4361fae0e3c1d15593a41c53ff18a..a89a00714f3370286e033ed3245e8c3b32a15c35 100644 (file)
@@ -39,7 +39,8 @@ static const struct super_operations securityfs_super_operations = {
        .evict_inode    = securityfs_evict_inode,
 };
 
-static int fill_super(struct super_block *sb, void *data, int silent)
+static int fill_super(struct super_block *sb, void *data, size_t data_size,
+                     int silent)
 {
        static const struct tree_descr files[] = {{""}};
        int error;
@@ -55,9 +56,9 @@ static int fill_super(struct super_block *sb, void *data, int silent)
 
 static struct dentry *get_sb(struct file_system_type *fs_type,
                  int flags, const char *dev_name,
-                 void *data)
+                 void *data, size_t data_size)
 {
-       return mount_single(fs_type, flags, data, fill_super);
+       return mount_single(fs_type, flags, data, data_size, fill_super);
 }
 
 static struct file_system_type fs_type = {
index 736e78da1ab9d09271b2f34ace7a247c91fd5778..3d99ed8d9ddd70d6753dd2e90202934b584d7d00 100644 (file)
@@ -373,20 +373,20 @@ void security_sb_free(struct super_block *sb)
        call_void_hook(sb_free_security, sb);
 }
 
-int security_sb_copy_data(char *orig, char *copy)
+int security_sb_copy_data(char *orig, size_t data_size, char *copy)
 {
-       return call_int_hook(sb_copy_data, 0, orig, copy);
+       return call_int_hook(sb_copy_data, 0, orig, data_size, copy);
 }
 EXPORT_SYMBOL(security_sb_copy_data);
 
-int security_sb_remount(struct super_block *sb, void *data)
+int security_sb_remount(struct super_block *sb, void *data, size_t data_size)
 {
-       return call_int_hook(sb_remount, 0, sb, data);
+       return call_int_hook(sb_remount, 0, sb, data, data_size);
 }
 
-int security_sb_kern_mount(struct super_block *sb, int flags, void *data)
+int security_sb_kern_mount(struct super_block *sb, int flags, void *data, size_t data_size)
 {
-       return call_int_hook(sb_kern_mount, 0, sb, flags, data);
+       return call_int_hook(sb_kern_mount, 0, sb, flags, data, data_size);
 }
 
 int security_sb_show_options(struct seq_file *m, struct super_block *sb)
@@ -400,9 +400,11 @@ int security_sb_statfs(struct dentry *dentry)
 }
 
 int security_sb_mount(const char *dev_name, const struct path *path,
-                       const char *type, unsigned long flags, void *data)
+                     const char *type, unsigned long flags,
+                     void *data, size_t data_size)
 {
-       return call_int_hook(sb_mount, 0, dev_name, path, type, flags, data);
+       return call_int_hook(sb_mount, 0, dev_name, path, type, flags,
+                            data, data_size);
 }
 
 int security_sb_umount(struct vfsmount *mnt, int flags)
index ad9a9b8e997941640b6de40fd9af4a1b17f39d04..48704d5a15afeb6d8c5f6f35031d75f1208b5683 100644 (file)
@@ -2791,7 +2791,7 @@ static inline void take_selinux_option(char **to, char *from, int *first,
        }
 }
 
-static int selinux_sb_copy_data(char *orig, char *copy)
+static int selinux_sb_copy_data(char *orig, size_t data_size, char *copy)
 {
        int fnosec, fsec, rc = 0;
        char *in_save, *in_curr, *in_end;
@@ -2833,7 +2833,7 @@ out:
        return rc;
 }
 
-static int selinux_sb_remount(struct super_block *sb, void *data)
+static int selinux_sb_remount(struct super_block *sb, void *data, size_t data_size)
 {
        int rc, i, *flags;
        struct security_mnt_opts opts;
@@ -2853,7 +2853,7 @@ static int selinux_sb_remount(struct super_block *sb, void *data)
        secdata = alloc_secdata();
        if (!secdata)
                return -ENOMEM;
-       rc = selinux_sb_copy_data(data, secdata);
+       rc = selinux_sb_copy_data(data, data_size, secdata);
        if (rc)
                goto out_free_secdata;
 
@@ -2918,7 +2918,7 @@ out_bad_option:
        goto out_free_opts;
 }
 
-static int selinux_sb_kern_mount(struct super_block *sb, int flags, void *data)
+static int selinux_sb_kern_mount(struct super_block *sb, int flags, void *data, size_t data_size)
 {
        const struct cred *cred = current_cred();
        struct common_audit_data ad;
@@ -2951,7 +2951,8 @@ static int selinux_mount(const char *dev_name,
                         const struct path *path,
                         const char *type,
                         unsigned long flags,
-                        void *data)
+                        void *data,
+                        size_t data_size)
 {
        const struct cred *cred = current_cred();
 
index f3a5a138a096d8cb7d1d42cd23e07eecbbd4a2a0..c3914eeb695c6dff05717067978589e02b4f3067 100644 (file)
@@ -1893,7 +1893,8 @@ static struct dentry *sel_make_dir(struct dentry *dir, const char *name,
 
 #define NULL_FILE_NAME "null"
 
-static int sel_fill_super(struct super_block *sb, void *data, int silent)
+static int sel_fill_super(struct super_block *sb, void *data, size_t data_size,
+                         int silent)
 {
        struct selinux_fs_info *fsi;
        int ret;
@@ -2010,9 +2011,10 @@ err:
 }
 
 static struct dentry *sel_mount(struct file_system_type *fs_type,
-                     int flags, const char *dev_name, void *data)
+                               int flags, const char *dev_name,
+                               void *data, size_t data_size)
 {
-       return mount_single(fs_type, flags, data, sel_fill_super);
+       return mount_single(fs_type, flags, data, data_size, sel_fill_super);
 }
 
 static void sel_kill_sb(struct super_block *sb)
index 340fc30ad85d7546dcb59b1f68afe286aed1cbba..03a2f0213d57f2a658da661434c2100042653434 100644 (file)
@@ -568,6 +568,7 @@ static void smack_sb_free_security(struct super_block *sb)
 /**
  * smack_sb_copy_data - copy mount options data for processing
  * @orig: where to start
+ * @orig_size: Size of orig buffer
  * @smackopts: mount options string
  *
  * Returns 0 on success or -ENOMEM on error.
@@ -575,7 +576,7 @@ static void smack_sb_free_security(struct super_block *sb)
  * Copy the Smack specific mount options out of the mount
  * options list.
  */
-static int smack_sb_copy_data(char *orig, char *smackopts)
+static int smack_sb_copy_data(char *orig, size_t orig_size, char *smackopts)
 {
        char *cp, *commap, *otheropts, *dp;
 
@@ -856,7 +857,8 @@ static int smack_set_mnt_opts(struct super_block *sb,
  *
  * Returns 0 on success, an error code on failure
  */
-static int smack_sb_kern_mount(struct super_block *sb, int flags, void *data)
+static int smack_sb_kern_mount(struct super_block *sb, int flags,
+                              void *data, size_t data_size)
 {
        int rc = 0;
        char *options = data;
index f6482e53d55a82d97882d40d04736247281a4239..f4e91c5d6c2cbbf750677937faebdaeb26b2a3f0 100644 (file)
@@ -2844,13 +2844,15 @@ static const struct file_operations smk_ptrace_ops = {
  * smk_fill_super - fill the smackfs superblock
  * @sb: the empty superblock
  * @data: unused
+ * @data_size: size of data buffer
  * @silent: unused
  *
  * Fill in the well known entries for the smack filesystem
  *
  * Returns 0 on success, an error code on failure
  */
-static int smk_fill_super(struct super_block *sb, void *data, int silent)
+static int smk_fill_super(struct super_block *sb, void *data, size_t data_size,
+                         int silent)
 {
        int rc;
        struct inode *root_inode;
@@ -2934,9 +2936,10 @@ static int smk_fill_super(struct super_block *sb, void *data, int silent)
  * Returns what the lower level code does.
  */
 static struct dentry *smk_mount(struct file_system_type *fs_type,
-                     int flags, const char *dev_name, void *data)
+                               int flags, const char *dev_name,
+                               void *data, size_t data_size)
 {
-       return mount_single(fs_type, flags, data, smk_fill_super);
+       return mount_single(fs_type, flags, data, data_size, smk_fill_super);
 }
 
 static struct file_system_type smk_fs_type = {
index 9f932e2d68521c2da50be376cb41c51d700425f4..07f1a0d3dd32927cb307c49062d8089c633bcf21 100644 (file)
@@ -399,11 +399,13 @@ static int tomoyo_path_chroot(const struct path *path)
  * @type:     Name of filesystem type. Maybe NULL.
  * @flags:    Mount options.
  * @data:     Optional data. Maybe NULL.
+ * @data_size: Size of data.
  *
  * Returns 0 on success, negative value otherwise.
  */
 static int tomoyo_sb_mount(const char *dev_name, const struct path *path,
-                          const char *type, unsigned long flags, void *data)
+                          const char *type, unsigned long flags,
+                          void *data, size_t data_size)
 {
        return tomoyo_mount_permission(dev_name, path, type, flags, data);
 }