diff options
author | Konstantin Belousov <kib@FreeBSD.org> | 2010-10-10 07:05:47 +0000 |
---|---|---|
committer | Konstantin Belousov <kib@FreeBSD.org> | 2010-10-10 07:05:47 +0000 |
commit | d0cc54f3b427a42751bb0a96ca8feaa6ac200073 (patch) | |
tree | a006cef67a086a26fbf62390901a1727666e6379 | |
parent | 21bf062e7e5319c852c5b7fbcab7fc6e19161c32 (diff) | |
download | src-d0cc54f3b427a42751bb0a96ca8feaa6ac200073.tar.gz src-d0cc54f3b427a42751bb0a96ca8feaa6ac200073.zip |
The r184588 changed the layout of struct export_args, causing an ABI
breakage for old mount(2) syscall, since most struct <filesystem>_args
embed export_args. The mount(2) is supposed to provide ABI
compatibility for pre-nmount mount(8) binaries, so restore ABI to
pre-r184588.
Requested and reviewed by: bde
MFC after: 2 weeks
Notes
Notes:
svn path=/head/; revision=213664
-rw-r--r-- | sys/fs/cd9660/cd9660_mount.h | 2 | ||||
-rw-r--r-- | sys/fs/cd9660/cd9660_vfsops.c | 4 | ||||
-rw-r--r-- | sys/fs/hpfs/hpfs_vfsops.c | 4 | ||||
-rw-r--r-- | sys/fs/hpfs/hpfsmount.h | 2 | ||||
-rw-r--r-- | sys/fs/msdosfs/msdosfs_vfsops.c | 4 | ||||
-rw-r--r-- | sys/fs/msdosfs/msdosfsmount.h | 2 | ||||
-rw-r--r-- | sys/fs/ntfs/ntfs_vfsops.c | 8 | ||||
-rw-r--r-- | sys/fs/ntfs/ntfsmount.h | 2 | ||||
-rw-r--r-- | sys/gnu/fs/reiserfs/reiserfs_mount.h | 2 | ||||
-rw-r--r-- | sys/gnu/fs/reiserfs/reiserfs_vfsops.c | 4 | ||||
-rw-r--r-- | sys/kern/vfs_mount.c | 8 | ||||
-rw-r--r-- | sys/sys/mount.h | 2 | ||||
-rw-r--r-- | sys/ufs/ffs/ffs_vfsops.c | 4 | ||||
-rw-r--r-- | sys/ufs/ufs/ufsmount.h | 2 |
14 files changed, 36 insertions, 14 deletions
diff --git a/sys/fs/cd9660/cd9660_mount.h b/sys/fs/cd9660/cd9660_mount.h index 518677d19ae2..f59dfc0c6875 100644 --- a/sys/fs/cd9660/cd9660_mount.h +++ b/sys/fs/cd9660/cd9660_mount.h @@ -40,7 +40,7 @@ */ struct iso_args { char *fspec; /* block special device to mount */ - struct export_args export; /* network export info */ + struct oexport_args export; /* network export info */ int flags; /* mounting flags, see below */ int ssector; /* starting sector, 0 for 1st session */ char *cs_disk; /* disk charset for Joliet cs conversion */ diff --git a/sys/fs/cd9660/cd9660_vfsops.c b/sys/fs/cd9660/cd9660_vfsops.c index e27daf8bb046..77757f2c64fc 100644 --- a/sys/fs/cd9660/cd9660_vfsops.c +++ b/sys/fs/cd9660/cd9660_vfsops.c @@ -98,14 +98,16 @@ static int cd9660_cmount(struct mntarg *ma, void *data, int flags) { struct iso_args args; + struct export_args exp; int error; error = copyin(data, &args, sizeof args); if (error) return (error); + vfs_oexport_conv(&args.export, &exp); ma = mount_argsu(ma, "from", args.fspec, MAXPATHLEN); - ma = mount_arg(ma, "export", &args.export, sizeof args.export); + ma = mount_arg(ma, "export", &exp, sizeof(exp)); ma = mount_argsu(ma, "cs_disk", args.cs_disk, 64); ma = mount_argsu(ma, "cs_local", args.cs_local, 64); ma = mount_argf(ma, "ssector", "%u", args.ssector); diff --git a/sys/fs/hpfs/hpfs_vfsops.c b/sys/fs/hpfs/hpfs_vfsops.c index 9aa95ffd3c37..676b5c711edc 100644 --- a/sys/fs/hpfs/hpfs_vfsops.c +++ b/sys/fs/hpfs/hpfs_vfsops.c @@ -76,14 +76,16 @@ hpfs_cmount ( int flags) { struct hpfs_args args; + struct export_args exp; int error; error = copyin(data, (caddr_t)&args, sizeof (struct hpfs_args)); if (error) return (error); + vfs_oexport_conv(&args.export, &exp); ma = mount_argsu(ma, "from", args.fspec, MAXPATHLEN); - ma = mount_arg(ma, "export", &args.export, sizeof args.export); + ma = mount_arg(ma, "export", &exp, sizeof(exp)); ma = mount_argf(ma, "uid", "%d", args.uid); ma = mount_argf(ma, "gid", "%d", args.gid); ma = mount_argf(ma, "mode", "%d", args.mode); diff --git a/sys/fs/hpfs/hpfsmount.h b/sys/fs/hpfs/hpfsmount.h index 3566776b96ad..5ca42b3bf66e 100644 --- a/sys/fs/hpfs/hpfsmount.h +++ b/sys/fs/hpfs/hpfsmount.h @@ -29,7 +29,7 @@ #define HPFSMNT_TABLES 0x0001 struct hpfs_args { char *fspec; /* block special device to mount */ - struct export_args export; /* network export information */ + struct oexport_args export; /* network export information */ uid_t uid; /* uid that owns hpfs files */ gid_t gid; /* gid that owns hpfs files */ mode_t mode; /* mask to be applied for hpfs perms */ diff --git a/sys/fs/msdosfs/msdosfs_vfsops.c b/sys/fs/msdosfs/msdosfs_vfsops.c index a0801bde22a5..e04ef9c14e82 100644 --- a/sys/fs/msdosfs/msdosfs_vfsops.c +++ b/sys/fs/msdosfs/msdosfs_vfsops.c @@ -200,6 +200,7 @@ static int msdosfs_cmount(struct mntarg *ma, void *data, int flags) { struct msdosfs_args args; + struct export_args exp; int error; if (data == NULL) @@ -207,9 +208,10 @@ msdosfs_cmount(struct mntarg *ma, void *data, int flags) error = copyin(data, &args, sizeof args); if (error) return (error); + vfs_oexport_conv(&args.export, &exp); ma = mount_argsu(ma, "from", args.fspec, MAXPATHLEN); - ma = mount_arg(ma, "export", &args.export, sizeof args.export); + ma = mount_arg(ma, "export", &exp, sizeof(exp)); ma = mount_argf(ma, "uid", "%d", args.uid); ma = mount_argf(ma, "gid", "%d", args.gid); ma = mount_argf(ma, "mask", "%d", args.mask); diff --git a/sys/fs/msdosfs/msdosfsmount.h b/sys/fs/msdosfs/msdosfsmount.h index 2951b2c9f0b6..417923fa8059 100644 --- a/sys/fs/msdosfs/msdosfsmount.h +++ b/sys/fs/msdosfs/msdosfsmount.h @@ -234,7 +234,7 @@ uint32_t msdosfs_fileno_map(struct mount *, uint64_t); */ struct msdosfs_args { char *fspec; /* blocks special holding the fs to mount */ - struct export_args export; /* network export information */ + struct oexport_args export; /* network export information */ uid_t uid; /* uid that owns msdosfs files */ gid_t gid; /* gid that owns msdosfs files */ mode_t mask; /* file mask to be applied for msdosfs perms */ diff --git a/sys/fs/ntfs/ntfs_vfsops.c b/sys/fs/ntfs/ntfs_vfsops.c index ab5eede3f722..b5e024be9932 100644 --- a/sys/fs/ntfs/ntfs_vfsops.c +++ b/sys/fs/ntfs/ntfs_vfsops.c @@ -119,14 +119,16 @@ ntfs_cmount ( void *data, int flags) { - int error; struct ntfs_args args; + struct export_args exp; + int error; - error = copyin(data, (caddr_t)&args, sizeof args); + error = copyin(data, &args, sizeof(args)); if (error) return (error); + vfs_oexport_conv(&args.export, &exp); ma = mount_argsu(ma, "from", args.fspec, MAXPATHLEN); - ma = mount_arg(ma, "export", &args.export, sizeof args.export); + ma = mount_arg(ma, "export", &exp, sizeof(exp)); ma = mount_argf(ma, "uid", "%d", args.uid); ma = mount_argf(ma, "gid", "%d", args.gid); ma = mount_argf(ma, "mode", "%d", args.mode); diff --git a/sys/fs/ntfs/ntfsmount.h b/sys/fs/ntfs/ntfsmount.h index 5497ad9f2176..f64652c4725d 100644 --- a/sys/fs/ntfs/ntfsmount.h +++ b/sys/fs/ntfs/ntfsmount.h @@ -34,7 +34,7 @@ struct ntfs_args { char *fspec; /* block special device to mount */ - struct export_args export; /* network export information */ + struct oexport_args export; /* network export information */ uid_t uid; /* uid that owns ntfs files */ gid_t gid; /* gid that owns ntfs files */ mode_t mode; /* mask to be applied for ntfs perms */ diff --git a/sys/gnu/fs/reiserfs/reiserfs_mount.h b/sys/gnu/fs/reiserfs/reiserfs_mount.h index f47c97610fca..fbb0b50a0eca 100644 --- a/sys/gnu/fs/reiserfs/reiserfs_mount.h +++ b/sys/gnu/fs/reiserfs/reiserfs_mount.h @@ -39,7 +39,7 @@ struct reiserfs_mount { /* Arguments to mount ReiserFS filesystems. */ struct reiserfs_args { char *fspec; /* blocks special holding the fs to mount */ - struct export_args export; /* network export information */ + struct oexport_args export; /* network export information */ }; #endif /* !defined _GNU_REISERFS_REISERFS_MOUNT_H */ diff --git a/sys/gnu/fs/reiserfs/reiserfs_vfsops.c b/sys/gnu/fs/reiserfs/reiserfs_vfsops.c index 6b4272e9660e..1b5ce88eef9c 100644 --- a/sys/gnu/fs/reiserfs/reiserfs_vfsops.c +++ b/sys/gnu/fs/reiserfs/reiserfs_vfsops.c @@ -52,14 +52,16 @@ static int reiserfs_cmount(struct mntarg *ma, void *data, int flags) { struct reiserfs_args args; + struct export_args exp; int error; error = copyin(data, &args, sizeof(args)); if (error) return (error); + vfs_oexport_conv(&args.export, &exp); ma = mount_argsu(ma, "from", args.fspec, MAXPATHLEN); - ma = mount_arg(ma, "export", &args.export, sizeof args.export); + ma = mount_arg(ma, "export", &exp, sizeof(exp)); error = kernel_mount(ma, flags); diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c index 98eb0c422a82..5b0fd00233af 100644 --- a/sys/kern/vfs_mount.c +++ b/sys/kern/vfs_mount.c @@ -1960,3 +1960,11 @@ kernel_vmount(int flags, ...) error = kernel_mount(ma, flags); return (error); } + +void +vfs_oexport_conv(const struct oexport_args *oexp, struct export_args *exp) +{ + + bcopy(oexp, exp, sizeof(*oexp)); + exp->ex_numsecflavors = 0; +} diff --git a/sys/sys/mount.h b/sys/sys/mount.h index d9b6ff4ed66b..be605b482f33 100644 --- a/sys/sys/mount.h +++ b/sys/sys/mount.h @@ -741,6 +741,8 @@ int vfs_modevent(module_t, int, void *); void vfs_mount_error(struct mount *, const char *, ...); void vfs_mountroot(void); /* mount our root filesystem */ void vfs_mountedfrom(struct mount *, const char *from); +void vfs_oexport_conv(const struct oexport_args *oexp, + struct export_args *exp); void vfs_ref(struct mount *); void vfs_rel(struct mount *); struct mount *vfs_mount_alloc(struct vnode *, struct vfsconf *, const char *, diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index 0a9b63959056..94951e45b973 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -463,6 +463,7 @@ static int ffs_cmount(struct mntarg *ma, void *data, int flags) { struct ufs_args args; + struct export_args exp; int error; if (data == NULL) @@ -470,9 +471,10 @@ ffs_cmount(struct mntarg *ma, void *data, int flags) error = copyin(data, &args, sizeof args); if (error) return (error); + vfs_oexport_conv(&args.export, &exp); ma = mount_argsu(ma, "from", args.fspec, MAXPATHLEN); - ma = mount_arg(ma, "export", &args.export, sizeof args.export); + ma = mount_arg(ma, "export", &exp, sizeof(exp)); error = kernel_mount(ma, flags); return (error); diff --git a/sys/ufs/ufs/ufsmount.h b/sys/ufs/ufs/ufsmount.h index d5669179dac2..03edd7314b82 100644 --- a/sys/ufs/ufs/ufsmount.h +++ b/sys/ufs/ufs/ufsmount.h @@ -40,7 +40,7 @@ */ struct ufs_args { char *fspec; /* block special device to mount */ - struct export_args export; /* network export information */ + struct oexport_args export; /* network export information */ }; #ifdef _KERNEL |