2008-01-24 19:36:51

by Miklos Szeredi

[permalink] [raw]
Subject: [patch 09/26] mount options: fix capifs

From: Miklos Szeredi <[email protected]>

Add a .show_options super operation to capifs.

Use generic_show_options() and save the complete option string in
capifs_remount().

Signed-off-by: Miklos Szeredi <[email protected]>
---

Index: linux/drivers/isdn/capi/capifs.c
===================================================================
--- linux.orig/drivers/isdn/capi/capifs.c 2007-10-09 22:31:38.000000000 +0200
+++ linux/drivers/isdn/capi/capifs.c 2008-01-24 11:37:42.000000000 +0100
@@ -52,6 +52,7 @@ static int capifs_remount(struct super_b
gid_t gid = 0;
umode_t mode = 0600;
char *this_char;
+ char *new_opt = kstrdup(data, GFP_KERNEL);

this_char = NULL;
while ((this_char = strsep(&data, ",")) != NULL) {
@@ -72,11 +73,16 @@ static int capifs_remount(struct super_b
return -EINVAL;
}
}
+
+ kfree(s->s_options);
+ s->s_options = new_opt;
+
config.setuid = setuid;
config.setgid = setgid;
config.uid = uid;
config.gid = gid;
config.mode = mode;
+
return 0;
}

@@ -84,6 +90,7 @@ static struct super_operations capifs_so
{
.statfs = simple_statfs,
.remount_fs = capifs_remount,
+ .show_options = generic_show_options,
};



--


2008-01-25 10:19:03

by Karsten Keil

[permalink] [raw]
Subject: Re: [patch 09/26] mount options: fix capifs

On Thu, Jan 24, 2008 at 08:33:50PM +0100, Miklos Szeredi wrote:
> From: Miklos Szeredi <[email protected]>
>
> Add a .show_options super operation to capifs.
>
> Use generic_show_options() and save the complete option string in
> capifs_remount().
>
> Signed-off-by: Miklos Szeredi <[email protected]>
Acked-by: Karsten Keil <[email protected]>
> ---
>
> Index: linux/drivers/isdn/capi/capifs.c
> ===================================================================
> --- linux.orig/drivers/isdn/capi/capifs.c 2007-10-09 22:31:38.000000000 +0200
> +++ linux/drivers/isdn/capi/capifs.c 2008-01-24 11:37:42.000000000 +0100
> @@ -52,6 +52,7 @@ static int capifs_remount(struct super_b
> gid_t gid = 0;
> umode_t mode = 0600;
> char *this_char;
> + char *new_opt = kstrdup(data, GFP_KERNEL);
>
> this_char = NULL;
> while ((this_char = strsep(&data, ",")) != NULL) {
> @@ -72,11 +73,16 @@ static int capifs_remount(struct super_b
> return -EINVAL;
> }
> }
> +
> + kfree(s->s_options);
> + s->s_options = new_opt;
> +
> config.setuid = setuid;
> config.setgid = setgid;
> config.uid = uid;
> config.gid = gid;
> config.mode = mode;
> +
> return 0;
> }
>
> @@ -84,6 +90,7 @@ static struct super_operations capifs_so
> {
> .statfs = simple_statfs,
> .remount_fs = capifs_remount,
> + .show_options = generic_show_options,
> };
>
>
>
> --

--
Karsten Keil
SuSE Labs
ISDN and VOIP development
SUSE LINUX Products GmbH, Maxfeldstr.5 90409 Nuernberg, GF: Markus Rex, HRB 16746 (AG Nuernberg)