Busybox[PATCH] for mount.c - enable fsc as a mount option for NFS

Denys Vlasenko vda.linux at googlemail.com
Wed May 13 22:12:42 UTC 2009


On Tuesday 12 May 2009 09:40, Roland Arnold wrote:
> Hi All,
> 
> This is a patch to mount.c to allow the file-system caching 'fsc' flag
> for NFS mounts. FS-Cache is new in the 2.6.30 kernel. Note that this
> changes the behaviour of the mount sys-call to pass through a string
> and not a struct anymore; it makes the code match what nfs-utils does
> - at least for NFS3.

AFAIKS this works only starting from 2.6.23. If you want to use that
anyway (which is a good idea, this struct nfs_mount_data
mustn't be invented in the first place), you need
to read /proc/version and do it conditionally.

Otherwise you'll make life of 2.4.x people miserable.

> --- orig/util-linux/mount.c	2009-05-09 13:35:41.854799281 +0200
> +++ mod/util-linux/mount.c	2009-05-09 13:33:23.147299934 +0200
> @@ -991,8 +991,9 @@ static int nfsmount(struct mntent *mp, l
>  	mclient = NULL;
> 
>  	/* NB: hostname, mounthost, filteropts must be free()d prior to return */
> -
> -	filteropts = xstrdup(filteropts); /* going to trash it later... */
> +
> +	free(mp->mnt_opts);
> +	mp->mnt_opts = xstrdup(filteropts); /* going to trash it later... */

Why?

--
vda


More information about the busybox mailing list