Re: nfs mount fail

From: Trond Myklebust
Date: Mon Oct 19 2009 - 03:53:19 EST


On Mon, 2009-10-19 at 00:31 -0700, Yinghai Lu wrote:
> On Mon, Oct 19, 2009 at 12:08 AM, Ingo Molnar <mingo@xxxxxxx> wrote:
> >
> > * Pekka Enberg <penberg@xxxxxxxxxxxxxx> wrote:
> >
> >> Hi Ingo,
> >>
> >> On Mon, 2009-10-19 at 08:54 +0200, Ingo Molnar wrote:
> >> > * Trond Myklebust <trond.myklebust@xxxxxxxxxx> wrote:
> >> >
> >> > > > yes. something miss merged again...
> >> > > >
> >> > > > need change some lines.
> >> > >
> >> > > This doesn't match mainline either. To do so, the above kfree() has to
> >> > > be at the end of the "Opt_xprt_rdma:" case...
> >> >
> >> > it's from a test patch in tip:out-of-tree:
> >> >
> >> > d40bc6b: <not-for-merge> nfs: fix nfs_parse_mount_options() double kfree()
> >> >
> >> > (attached below)
> >> >
> >> > that fix is wrong apparently - is there a correct fix upstream perhaps?
> >>
> >> AFAICT, yes. See commit d508afb437daee7cf07da085b635c44a4ebf9b38 ("NFS:
> >> Fix a double free in nfs_parse_mount_options()") from Trond.
> >
> > sigh. That was written 3 days after your and Yinghai's patch was sent -
> > there's no Reported-by credit, there was no Cc: back to the original
> > thread - plus there was a memory leak was left in there as well. Trond?

Not sure what happened there, but I do know that evolution-2.26 manages
to lose my exchange based email every now and again. It is possible that
was why I lost track of the original patch...

> sth like this to fix possible mem leaking...
>
> diff --git a/fs/nfs/super.c b/fs/nfs/super.c
> index a2c18ac..90be551 100644
> --- a/fs/nfs/super.c
> +++ b/fs/nfs/super.c
> @@ -1253,6 +1253,7 @@ static int nfs_parse_mount_options(char *raw,
> default:
> dfprintk(MOUNT, "NFS: unrecognized "
> "transport protocol\n");
> + kfree(string);
> return 0;
> }
> break;

There is a possible clean up there too. We can move the other kfree()
calls out of the inner switch statement, and coalesce them all into a
single call.

Trond

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/