From: Ian Campbell Subject: Re: [PATCH] minios: Fix xenbus_rm() calls in frontend drivers Date: Fri, 6 Sep 2013 10:00:29 +0100 Message-ID: <1378458029.14745.74.camel@kazak.uk.xensource.com> References: <1378340720-8653-1-git-send-email-msw@linux.com> <1378372641.14745.4.camel@kazak.uk.xensource.com> <20130905180615.GA14603@u109add4315675089e695.ant.amazon.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1VHru4-0006Dg-Ge for xen-devel@lists.xenproject.org; Fri, 06 Sep 2013 09:00:32 +0000 In-Reply-To: <20130905180615.GA14603@u109add4315675089e695.ant.amazon.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Matt Wilson Cc: Ben Cressey , xen-devel@lists.xenproject.org, Stefano Stabellini , Matt Wilson , Samuel Thibault List-Id: xen-devel@lists.xenproject.org On Thu, 2013-09-05 at 11:06 -0700, Matt Wilson wrote: > On Thu, Sep 05, 2013 at 10:17:21AM +0100, Ian Campbell wrote: > > On Wed, 2013-09-04 at 17:25 -0700, Matt Wilson wrote: > > > From: Ben Cressey > > > > > > The commit "minios: refactor xenbus state machine" caused "/state" to > > > be appended to the local value of nodename. Previously the nodename > > > variable pointed to dev->nodename. > > > > > > The xenbus_rm() calls were not updated to reflect this change, and > > > refer to paths that do not exist. > > > > > > For example, shutdown_blkfront() for vbd 2049 would issue these calls: > > > xenbus_rm(XBT_NIL, "device/vbd/2049/state/ring-ref"); > > > xenbus_rm(XBT_NIL, "device/vbd/2049/state/event-channel"); > > > > > > This patch restores the previous behavior, issuing these calls > > > instead: > > > xenbus_rm(XBT_NIL, "device/vbd/2049/ring-ref"); > > > xenbus_rm(XBT_NIL, "device/vbd/2049/event-channel"); > > > > > > In addition, remove cases where the error message pointer is already > > > NULL and is then set to NULL. These are harmless, but suggest > > > incorrect practice: the pointer should be passed to free() to > > > deallocate memory prior to reassignment. > > > > Seems sensible to me. > > > > > Signed-off-by: Ben Cressey > > > Reviewed-by: Matt Wilson > > > Cc: Stefano Stabellini > > > Cc: Samuel Thibault > > > Signed-off-by: Matt Wilson > > > > > char path[strlen(dev->backend) + 1 + 5 + 1]; > > > - char nodename[strlen(dev->nodename) + 1 + 5 + 1]; > > > + char nodename[strlen(dev->nodename) + 1 + 13 + 1]; > > > > These changes don't seem to be covered by the commit message? I assume > > they relate to the length of the longest suffix which we are appending, > > perhaps using strlen("some-string-const") would make this more obvious? > > Yes, those are length related changes. I'd like to keep the code as-is > (following the established pattern) for this round Why? What is the benefit to keeping it this way when you are changing it anyway? > unless Stefano > objects. I wouldn't object to a commit message adjustment from the > committer. > > --msw