From patchwork Tue May 7 01:37:53 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 2529791 Return-Path: X-Original-To: patchwork-ceph-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 93FB33FD85 for ; Tue, 7 May 2013 01:37:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759547Ab3EGBh4 (ORCPT ); Mon, 6 May 2013 21:37:56 -0400 Received: from mail-ie0-f170.google.com ([209.85.223.170]:38427 "EHLO mail-ie0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759433Ab3EGBhz (ORCPT ); Mon, 6 May 2013 21:37:55 -0400 Received: by mail-ie0-f170.google.com with SMTP id aq17so56032iec.15 for ; Mon, 06 May 2013 18:37:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding :x-gm-message-state; bh=avmpHdMpVO0gfYKPpBL1ZgDkgAPkfN7uKl5dxfr5uT8=; b=PSDNILB8hbgKtfPPzuH49/3E1t7BXOkHhgOaNu+Hr4ABOBRSiEjmm/zm0KeKWzhfXR Oqpfbqh/i1ifdNeN0ML47GSavJOC6Rj2EKfXHYqjP8mX4rWB1d2qrw4OCjNCXYq/rj2P 1E95FpynMYX9H6QAXfdvGSfsZD44I150H49BUCPmjoiRlsX4y4tqfGtIlpAZ2eS56Wu0 UM5x0QCd/Ft1lobuDoPbdoH0WtsSpV84+LP3fO2gCCKaPsgkbhm0Je6VDjR7ULlPCrdV H7QLCy6v7XszHzSJQoyAK9TXKbmoPSEm+IbpA2TPYrMUb7Be3RkQ+rUev4dvsXvoKjBV pJ9w== X-Received: by 10.50.115.36 with SMTP id jl4mr3348625igb.8.1367890675412; Mon, 06 May 2013 18:37:55 -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 ESMTPSA id 9sm5170877igy.7.2013.05.06.18.37.54 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 06 May 2013 18:37:54 -0700 (PDT) Message-ID: <51885AF1.5080609@inktank.com> Date: Mon, 06 May 2013 20:37:53 -0500 From: Alex Elder User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130329 Thunderbird/17.0.5 MIME-Version: 1.0 To: ceph-devel@vger.kernel.org Subject: [PATCH 3/6] rbd: don't print warning if not mapping a parent References: <51885A97.9070005@inktank.com> In-Reply-To: <51885A97.9070005@inktank.com> X-Gm-Message-State: ALoCoQnh3h6nnwEBla3Df5fv07hMxowz9C4U7LkTzOH5tcpMEtF6M8/+hO1Nha4LXrQNKGmD5bng Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org The presence of the LAYERING bit in an rbd image's feature mask does not guarantee the image actually has a parent image. Currently that bit is set only when a clone (i.e., image with a parent) is created, but it is (currently) not cleared if that clone gets flattened back into a "normal" image. A "parent_id" query will leave the parent_spec for the image being mapped a null pointer, but will not return an error. Currently, whenever an image with the LAYERED feature gets mapped, a warning about the use of layered images gets printed. But we don't want to do this for a flattened image, so print the warning only if we find there is a parent spec after the probe. Signed-off-by: Alex Elder Reviewed-by: Josh Durgin --- drivers/block/rbd.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) } diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 0a24cdf..7d93dbd 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -4567,13 +4567,14 @@ static int rbd_dev_v2_probe(struct rbd_device *rbd_dev) ret = rbd_dev_v2_parent_info(rbd_dev); if (ret) goto out_err; - /* - * Don't print a warning for parent images. We can - * tell this point because we won't know its pool - * name yet (just its pool id). + * Print a warning if this image has a parent. + * Don't print it if the image now being probed + * is itself a parent. We can tell at this point + * because we won't know its pool name yet (just its + * pool id). */ - if (rbd_dev->spec->pool_name) + if (rbd_dev->parent_spec && rbd_dev->spec->pool_name) rbd_warn(rbd_dev, "WARNING: kernel layering " "is EXPERIMENTAL!");