[PATCH] mount, cifs bug in 1.20.2 Kernel > 3.3.7

Cristian Ionescu-Idbohrn cristian.ionescu-idbohrn at axis.com
Mon Nov 12 18:00:03 UTC 2012


Denys?

On Mon, 12 Nov 2012, Martin Santesson wrote:
> On 10/30/2012 03:53 PM, Martin Santesson wrote:
> > Hi,
> >
> > I also ran into this problem. I wrote a patch which supplies the unc
> > option the kernel. Tested with Linux kernel 2.6.35, 3.2 (prior to
> > mandatory unc option) and 3.4. Please have a look at my patch and let me
> > know if it needs to be revised.
> >
> > Regards,
> >
> > Martin
> >
> > > From fa16a76caebf1dfda1db81f0885e101624ac1462 Mon Sep 17 00:00:00 2001
> > From: Martin Santesson<martinsn at axis.com>
> > Date: Fri, 26 Oct 2012 09:40:04 +0200
> > Subject: [PATCH] mount: add unc option to CIFS mount (needed for Linux 3.4+)
> >
> > unc option for CIFS mount is mandatory after CIFS option parsing
> > was rewritten in Linux 3.4
> >
> > Signed-off-by: Martin Santesson<martinsn at axis.com>
> > ---
> >    busybox/util-linux/mount.c |   11 ++++++++++-
> >    1 files changed, 10 insertions(+), 1 deletions(-)
> >
> > diff --git a/busybox/util-linux/mount.c b/busybox/util-linux/mount.c
> > index 0f213bb..d990ebc 100644
> > --- a/busybox/util-linux/mount.c
> > +++ b/busybox/util-linux/mount.c
> > @@ -1638,7 +1638,7 @@ static int singlemount(struct mntent *mp, int
> > ignore_busy)
> >    		int len;
> >    		char c;
> >    		len_and_sockaddr *lsa;
> > -		char *hostname, *dotted, *ip;
> > +		char *hostname, *dotted, *ip, *share, *unc;
> >
> >    		hostname = mp->mnt_fsname + 2;
> >    		len = strcspn(hostname, "/\\");
> > @@ -1646,6 +1646,15 @@ static int singlemount(struct mntent *mp, int
> > ignore_busy)
> >    			goto report_error;
> >    		c = hostname[len];
> >    		hostname[len] = '\0';
> > +
> > +		share = hostname + len + 1;
> > +		if (share[0] == '\0')
> > +			goto report_error;
> > +		// Insert "unc=\\hostname\share" option into options
> > +		unc = xasprintf("unc=\\\\%s\\%s", hostname, share);
> > +		parse_mount_options(unc,&filteropts);
> > +		if (ENABLE_FEATURE_CLEAN_UP) free(unc);
> > +
> >    		lsa = host2sockaddr(hostname, 0);
> >    		hostname[len] = c;
> >    		if (!lsa)
> >
>
> Any other feedback on this patch?

Any chanse of applying this?


Cheers,

-- 
Cristian


More information about the busybox mailing list