From mboxrd@z Thu Jan 1 00:00:00 1970 From: Josh Durgin Subject: Re: [PATCH] rbd: simplify __rbd_init_snaps_header() Date: Tue, 07 Aug 2012 18:29:59 -0700 Message-ID: <5021C117.5000503@inktank.com> References: <502002D4.6070701@inktank.com> <5021A462.2030603@inktank.com> <5021BAD9.5000501@inktank.com> <5021C06F.2050600@inktank.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from mail-yw0-f46.google.com ([209.85.213.46]:53265 "EHLO mail-yw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754752Ab2HHBaC (ORCPT ); Tue, 7 Aug 2012 21:30:02 -0400 Received: by yhmm54 with SMTP id m54so264795yhm.19 for ; Tue, 07 Aug 2012 18:30:02 -0700 (PDT) In-Reply-To: <5021C06F.2050600@inktank.com> Sender: ceph-devel-owner@vger.kernel.org List-ID: To: Alex Elder Cc: "ceph-devel@vger.kernel.org" On 08/07/2012 06:27 PM, Alex Elder wrote: > On 08/07/2012 06:03 PM, Alex Elder wrote: >>>> + __rbd_remove_snap_dev(snap); >>>> + >>>> + /* Done with this list entry; advance */ >>>> + >>>> + links = next; >>> >>> This could just be links = links->next like you have later. >> >> I just used "next" because I had it available here but not >> below. I do like consistency though so I'll make your >> suggested change. > > After looking at it again, I don't think you're right. > > The reason is that __rbd_remove_snap_dev() actually unlinks > the "snap" from the list that contains it, and "links" at > this point is referring to &snap->node, which is modified > by the list deletion. > > The assignment I had originally, which uses a saved copy > of links->next, is the correct one. So I'll be committing > with my original version of this section of code. > > -Alex Ah, good point. That's fine then. Josh