From patchwork Wed Oct 12 14:04:48 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Dryomov X-Patchwork-Id: 9373245 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2C86A60839 for ; Wed, 12 Oct 2016 14:05:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1EFE229E12 for ; Wed, 12 Oct 2016 14:05:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1369629E13; Wed, 12 Oct 2016 14:05:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F285E29E1C for ; Wed, 12 Oct 2016 14:05:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755160AbcJLOFA (ORCPT ); Wed, 12 Oct 2016 10:05:00 -0400 Received: from mail-qk0-f195.google.com ([209.85.220.195]:35957 "EHLO mail-qk0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755122AbcJLOE6 (ORCPT ); Wed, 12 Oct 2016 10:04:58 -0400 Received: by mail-qk0-f195.google.com with SMTP id z190so3660679qkc.3 for ; Wed, 12 Oct 2016 07:04:58 -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=zUdC26kKTV/YZY9w5IzxO/jiZbg4+ghrOssXsju00jI=; b=qktigDvbyYFaJNiXrKQ609sQfb0x9uD9u4nNbhTpbYlqlqgV+to1tlj+OQaTExVM3O es6VGO0BbfdPKb/6PeCDai0zxiN+38NZ3t19kcwmUuOmPMQ7vStoN3s5CpcMuGEZ4Itk 4crKb8cPYY1lUPyiySXTpSeCs8hdW8Z+84rqi5VBiSZMMBM68zKaMPpJ3H0+7myKuov1 /NmG+tKut+OUuuuhG1vT/bwfsvvua5wjdODmv4b9qevfEURsSdMPpyPnLUpalUZw6lAS feOXEo0xLN6xiE22EEaF4J2hLaXRdr6eARa6FjZVS+LluZd5YwCN5RKg12KUyr03dseD 1MVA== 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=zUdC26kKTV/YZY9w5IzxO/jiZbg4+ghrOssXsju00jI=; b=F7lCaMHTGUOcDerzLYdZTDew6r6R2f8EgboSRVTQjh4DoG84l2KL12LDaYIIvwwkfG w218/QSX1ujV5gV8FYxwmkL4F6G35w9UlyYKDWVbiioz+KdVSu6aqkefycyruiPoY2ul 8UEdM70MelZHXL+AxzR5xq71CzCyIxDv5A9XysE7Za398u+X255d37nzIM6z/NZNUHV9 WTAoXVClpfoM+Q+i/BqN0EKjFWjxhGAF1kEyY8Tc3SOytYXv0CyCL/dnAeS6fRQK6fed xXkVgdMZA00Zdyl0m8puPRxVKX0PT9HBRB85VM+evgSSBSpG9m2TaSugt03+UQR9zaHt xbvA== X-Gm-Message-State: AA6/9Rnfy8g1Noby3Yyxsh62VjpNlRf/t8s4bwsweY8COjie5jmBWdVgWV1TIvQ5y7qdmA== X-Received: by 10.194.107.162 with SMTP id hd2mr1767495wjb.0.1476281097477; Wed, 12 Oct 2016 07:04:57 -0700 (PDT) Received: from localhost.localdomain.com (ip-78-102-108-116.net.upcbroadband.cz. [78.102.108.116]) by smtp.gmail.com with ESMTPSA id za1sm9118726wjb.8.2016.10.12.07.04.56 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 12 Oct 2016 07:04:56 -0700 (PDT) From: Ilya Dryomov To: ceph-devel@vger.kernel.org Subject: [PATCH] rbd: don't retry watch reregistration if header object is gone Date: Wed, 12 Oct 2016 16:04:48 +0200 Message-Id: <1476281088-30667-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-Virus-Scanned: ClamAV using ClamSMTP If the header object gets deleted (perhaps along with the entire pool), there is no point in attempting to reregister the watch. Treat this the same as blacklisting: fail all pending and new I/Os requiring the lock. Signed-off-by: Ilya Dryomov --- 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 fbc025a87261..2acb3f04c37b 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -3944,7 +3944,7 @@ static void rbd_reregister_watch(struct work_struct *work) ret = __rbd_register_watch(rbd_dev); if (ret) { rbd_warn(rbd_dev, "failed to reregister watch: %d", ret); - if (ret == -EBLACKLISTED) { + if (ret == -EBLACKLISTED || ret == -ENOENT) { set_bit(RBD_DEV_FLAG_BLACKLISTED, &rbd_dev->flags); need_to_wake = true; } else {