[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <cc557aab1002240528t28eae36dj976525be2fcf7246@mail.gmail.com>
Date: Wed, 24 Feb 2010 15:28:31 +0200
From: "Kirill A. Shutemov" <kirill@...temov.name>
To: Li Zefan <lizf@...fujitsu.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Paul Menage <menage@...gle.com>,
KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>,
LKML <linux-kernel@...r.kernel.org>,
"containers@...ts.osdl.org" <containers@...ts.osdl.org>
Subject: Re: [PATCH -mm] cgroups: fix failure path in cgroup_write_event_control()
On Wed, Feb 24, 2010 at 5:22 AM, Li Zefan <lizf@...fujitsu.com> wrote:
> How to reproduce:
>
> # mount -t cgroup -o memory xxx /cgroup
> # mkdir /cgroup/tmp
> # ./cgroup_event_listener /cgroup/tmp/cgroup.event_control abc
> ^C
> # rmdir /cgroup/tmp
> # cat /proc/cgroups | grep memory
> memory 2 2 1 (should be "2 1 1")
> # umount /cgroup
> (failed!)
>
> Using a single goto label to cleanup multi failure paths can
> get things wrong quite easily, while multi labels makes the
> code cleaner.
I disagree.
It's easer to make mistake on changing code with multi failure
paths, if you want to move a code within function.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists