From patchwork Fri Apr 15 19:25:45 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Dryomov X-Patchwork-Id: 8856631 Return-Path: X-Original-To: patchwork-ceph-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B5CAE9F36E for ; Fri, 15 Apr 2016 19:26:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D83FD2021A for ; Fri, 15 Apr 2016 19:26:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 02DD820212 for ; Fri, 15 Apr 2016 19:26:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932142AbcDOT0R (ORCPT ); Fri, 15 Apr 2016 15:26:17 -0400 Received: from mail-qk0-f182.google.com ([209.85.220.182]:33843 "EHLO mail-qk0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932138AbcDOT0O (ORCPT ); Fri, 15 Apr 2016 15:26:14 -0400 Received: by mail-qk0-f182.google.com with SMTP id r184so41272820qkc.1 for ; Fri, 15 Apr 2016 12:26:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id; bh=seasxov5z4coqJfMqONa+uHZNziiOf2z94oVUbROB+k=; b=pxbdQciMY/st4GHW2SQidHeHzGm39UAXGaTu/Z+LTOFpCYLe4bo8dE9FFz9Ohl5kOQ 2NmDurIBYjKvBaSb0bwZ45FGdsofNHkV3Cq89bwHOIO0052PPQVwlXkyxIDjG1atuQ5V HGRs4Y/cCP6Uu9el2P5F0uDr8qzq+sxfSWTloUWZACJ59kSp2WlFRzyhnLXnYJ9q+945 Hb5t8h2OlHTKptoU9dklQxCnQduDaQFaN9iYlDQ/lPl+Y/R9uSvYOJ64/MgJlfEO+7cq zu7mXQ9UW8ubFgisg/Qfr1cfMEnYv6HodwqBnQYnTxNm9j2LstmMT09ooEItO6vOcOS2 J+Hw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id; bh=seasxov5z4coqJfMqONa+uHZNziiOf2z94oVUbROB+k=; b=bykIcLqfG40OZl7rehtg7cPFYoulRibuBhS3FYNsty9FJhOaJ2ExRvzEQT/6zHU+es JalO6QeiKd6DX2V3KQLtSxugrUWLsB7uD7+0LSlxzTw/aC6xQLsQOMkpv3Nel8baX19t NGk9szqGA6cUvQHn8X3+eCmZLMeFeS+zLo3rAumz4uCBWlug1763HaJoVHBhqz30S8RB 1tr0IbTSwQRjmTiz/pNS3USW+RUyLUCoKJhCAGzx/pp9ogUqb58z9UJ5ZQqR8+wB3gkF rmS4k3FqlJk8vd3534XDqwQvtgBzota5vsno50jI1Es1YjZZ/IM1sJU6d9hK0+Bf/xwv 5Buw== X-Gm-Message-State: AOPr4FXaC5r5tcyVmXTmQbN+ViBqaTD+mrbEvrhTtbTosScjK0TfjKofDVpGdtn1xx18Pw== X-Received: by 10.55.79.207 with SMTP id d198mr27916302qkb.49.1460748373619; Fri, 15 Apr 2016 12:26:13 -0700 (PDT) Received: from dhcp-1-141.brq.redhat.com (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id n124sm14282526qhc.37.2016.04.15.12.26.12 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Apr 2016 12:26:12 -0700 (PDT) From: Ilya Dryomov To: ceph-devel@vger.kernel.org Subject: [PATCH] rbd: report unsupported features to syslog Date: Fri, 15 Apr 2016 21:25:45 +0200 Message-Id: <1460748345-3717-1-git-send-email-idryomov@gmail.com> X-Mailer: git-send-email 2.4.3 Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP ... instead of just returning an error. Signed-off-by: Ilya Dryomov Reviewed-by: Josh Durgin Reviewed-by: Douglas Fuller --- drivers/block/rbd.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 9f1eb00b5e64..78aca585e7e5 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -4184,7 +4184,7 @@ static int _rbd_dev_v2_snap_features(struct rbd_device *rbd_dev, u64 snap_id, __le64 features; __le64 incompat; } __attribute__ ((packed)) features_buf = { 0 }; - u64 incompat; + u64 unsup; int ret; ret = rbd_obj_method_sync(rbd_dev, rbd_dev->header_name, @@ -4197,9 +4197,12 @@ static int _rbd_dev_v2_snap_features(struct rbd_device *rbd_dev, u64 snap_id, if (ret < sizeof (features_buf)) return -ERANGE; - incompat = le64_to_cpu(features_buf.incompat); - if (incompat & ~RBD_FEATURES_SUPPORTED) + unsup = le64_to_cpu(features_buf.incompat) & ~RBD_FEATURES_SUPPORTED; + if (unsup) { + rbd_warn(rbd_dev, "image uses unsupported features: 0x%llx", + unsup); return -ENXIO; + } *snap_features = le64_to_cpu(features_buf.features);