From patchwork Tue Sep 4 18:08:16 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 1403581 Return-Path: X-Original-To: patchwork-ceph-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 928EDDF280 for ; Tue, 4 Sep 2012 18:08:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757428Ab2IDSIU (ORCPT ); Tue, 4 Sep 2012 14:08:20 -0400 Received: from mail-ie0-f174.google.com ([209.85.223.174]:42150 "EHLO mail-ie0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757425Ab2IDSIT (ORCPT ); Tue, 4 Sep 2012 14:08:19 -0400 Received: by ieje11 with SMTP id e11so5580327iej.19 for ; Tue, 04 Sep 2012 11:08:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding:x-gm-message-state; bh=P+ryYf+HYXuIFHXAh8Nrjlc/GkewYWlajci6npMiDII=; b=mvGaz/K7LetN76cj96Y+WeVU1DFvNi9XUjKl9lRWGDaY5WvdvwISB77DdSJQEYRTRk mmSPg+v6eyQKF8mleBgXjpMFdPk04SnJ06cTGSykK8h1boMskc+aJ8MawFnBfTm6fnP5 ZT3jOpASbHJgCBjs84YXhchQ20d2g+f/XNyowtDdsKG6bqEn6VnE7bVKZkUl0lyDuVoD 1FyVGUtV1rTbjsP86szDQ99MmQdmMwOIU1T9vTxMeV6FgiZT49yuZjDx+kx6SuouUVU5 izZhgNc4Aqj0Y36jHodZp0TRs3xKVrpO+h7JhGpj93RNgBK6GSRQiHybe9f4Q1bwXm+h JrVA== Received: by 10.50.181.200 with SMTP id dy8mr15285827igc.36.1346782098878; Tue, 04 Sep 2012 11:08:18 -0700 (PDT) Received: from [172.22.22.4] (c-71-195-31-37.hsd1.mn.comcast.net. [71.195.31.37]) by mx.google.com with ESMTPS id q1sm27229389igj.15.2012.09.04.11.08.17 (version=SSLv3 cipher=OTHER); Tue, 04 Sep 2012 11:08:17 -0700 (PDT) Message-ID: <50464390.3010107@inktank.com> Date: Tue, 04 Sep 2012 13:08:16 -0500 From: Alex Elder User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120827 Thunderbird/15.0 MIME-Version: 1.0 To: "ceph-devel@vger.kernel.org" Subject: [PATCH] rbd: add new snapshots at the tail X-Gm-Message-State: ALoCoQkkh6emSm8lU8mpKPuewRIhBWxJiJpijK6IeClkmyjJzo+UuddRgj8QMlabVYGRZ0Z1bkgD Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org This fixes a bug that went in with this commit: commit f6e0c99092cca7be00fca4080cfc7081739ca544 Author: Alex Elder Date: Thu Aug 2 11:29:46 2012 -0500 rbd: simplify __rbd_init_snaps_header() The problem is that a new rbd snapshot needs to go either after an existing snapshot entry, or at the *end* of an rbd device's snapshot list. As originally coded, it is placed at the beginning. This was based on the assumption the list would be empty (so it wouldn't matter), but in fact if multiple new snapshots are added to an empty list in one shot the list will be non-empty after the first one is added. This addresses http://tracker.newdream.net/issues/3063 Signed-off-by: Alex Elder Reviewed-by: Josh Durgin --- drivers/block/rbd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 8e6e29e..fd51f9d 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -2187,7 +2187,7 @@ static int __rbd_init_snaps_header(struct rbd_device *rbd_dev) if (snap) list_add_tail(&new_snap->node, &snap->node); else - list_add(&new_snap->node, head); + list_add_tail(&new_snap->node, head); } else { /* Already have this one */