[libvirt] [PATCH v2]lxc: do cleanup when failed to bind fs as read-only

From: Chen Hanxiao <chenhanxiao@cn.fujitsu.com> We forgot to do cleanup when lxcContainerMountFSTmpfs failed to bind fs as read-only. v2: fix an indentation issue Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com> --- src/lxc/lxc_container.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c index c60f5d8..b1f429c 100644 --- a/src/lxc/lxc_container.c +++ b/src/lxc/lxc_container.c @@ -1451,6 +1451,7 @@ static int lxcContainerMountFSTmpfs(virDomainFSDefPtr fs, virReportSystemError(errno, _("Failed to make directory %s readonly"), fs->dst); + goto cleanup; } } -- 1.8.2.1

On 09/30/2013 03:06 AM, Chen Hanxiao wrote:
From: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
We forgot to do cleanup when lxcContainerMountFSTmpfs failed to bind fs as read-only.
v2: fix an indentation issue
Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com> --- src/lxc/lxc_container.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c index c60f5d8..b1f429c 100644 --- a/src/lxc/lxc_container.c +++ b/src/lxc/lxc_container.c @@ -1451,6 +1451,7 @@ static int lxcContainerMountFSTmpfs(virDomainFSDefPtr fs, virReportSystemError(errno, _("Failed to make directory %s readonly"), fs->dst); + goto cleanup;
ACK and pushed. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On 09/30/2013 01:29 PM, Eric Blake wrote:
On 09/30/2013 03:06 AM, Chen Hanxiao wrote:
From: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
We forgot to do cleanup when lxcContainerMountFSTmpfs failed to bind fs as read-only.
v2: fix an indentation issue
Oh, and a side note. Patch changelogs, such as this paragraph...
Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com> ---
...belong here, after the ---, so that 'git am' won't make them part of the permanent git history. They're highly useful to reviewers, but not so much when revisiting the code a year from now when we don't care how many iterations it took to get to a final patch.
ACK and pushed.
so I amended before actually pushing. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

-----Original Message----- From: Eric Blake [mailto:eblake@redhat.com] Sent: Tuesday, October 01, 2013 3:38 AM Cc: Chen Hanxiao; libvir-list@redhat.com Subject: Re: [libvirt] [PATCH v2]lxc: do cleanup when failed to bind fs as read-only
On 09/30/2013 01:29 PM, Eric Blake wrote:
On 09/30/2013 03:06 AM, Chen Hanxiao wrote:
From: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
We forgot to do cleanup when lxcContainerMountFSTmpfs failed to bind fs as read-only.
v2: fix an indentation issue
Oh, and a side note. Patch changelogs, such as this paragraph...
Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com> ---
...belong here, after the ---, so that 'git am' won't make them part of the permanent git history. They're highly useful to reviewers, but not so much when revisiting the code a year from now when we don't care how many iterations it took to get to a final patch.
Thanks for your correction!
ACK and pushed.
so I amended before actually pushing.
-- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
participants (2)
-
Chen Hanxiao
-
Eric Blake