From patchwork Wed Nov 5 17:33:22 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Dryomov X-Patchwork-Id: 5236841 Return-Path: X-Original-To: patchwork-ceph-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 042B1C11AC for ; Wed, 5 Nov 2014 17:33:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 15ACF20145 for ; Wed, 5 Nov 2014 17:33:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3C52520138 for ; Wed, 5 Nov 2014 17:33:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754975AbaKERdq (ORCPT ); Wed, 5 Nov 2014 12:33:46 -0500 Received: from mail-la0-f44.google.com ([209.85.215.44]:45735 "EHLO mail-la0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754590AbaKERdq (ORCPT ); Wed, 5 Nov 2014 12:33:46 -0500 Received: by mail-la0-f44.google.com with SMTP id gf13so1094729lab.31 for ; Wed, 05 Nov 2014 09:33:43 -0800 (PST) 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:in-reply-to :references; bh=Gjyp9WOIodelepb3KAVs3a6uIdEDLc7faiqZw+nof1o=; b=HFPg3whlrys4cfg56HYCzqXKLiJGg/IL7Z1aQR1hO3EPDv3Y3gLy882r9I3Rfq0dFs NOhFfviGsM3Es827tzX11QP3YPu+YGQ8QGCfCIUl0Oa1y99nAI4S9A742SD6Ob+teZWQ sHGgiUBC3TWYJx7T04kGOkaGiua48+DQPFWKdUO9MHm/bbkFlukyVi/Yd0+2sBEe/f+a IcAEcIk7rqVRv0HkSH8lFpkTRJWS7+XoLtogiTOUrW8cmy7OW+0rFAHTeJSgturMhRAo /wFU3cRF33/LNHFc/IK0xGmlfOMhqN3TkjY+A4aGX1WHkchWQFdhXpSIMKbL9UBxL08v etZA== X-Gm-Message-State: ALoCoQn96aUFBiKXgS18bbLr/ID+/Br+J71P2/srdUkQvkW3YNML1OzCc8l7pZ4ecyQ1fv0ZRNC7 X-Received: by 10.152.44.161 with SMTP id f1mr30707788lam.17.1415208821564; Wed, 05 Nov 2014 09:33:41 -0800 (PST) Received: from localhost ([109.110.66.36]) by mx.google.com with ESMTPSA id ql6sm1546994lbb.31.2014.11.05.09.33.39 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 05 Nov 2014 09:33:40 -0800 (PST) From: Ilya Dryomov X-Google-Original-From: Ilya Dryomov To: ceph-devel@vger.kernel.org Subject: [PATCH 1/3] libceph: unlink from o_linger_requests when clearing r_osd Date: Wed, 5 Nov 2014 20:33:22 +0300 Message-Id: <1415208804-10163-2-git-send-email-idryomov@redhat.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1415208804-10163-1-git-send-email-idryomov@redhat.com> References: <1415208804-10163-1-git-send-email-idryomov@redhat.com> 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.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, 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 Requests have to be unlinked from both osd->o_requests (normal requests) and osd->o_linger_requests (linger requests) lists when clearing req->r_osd. Otherwise __unregister_linger_request() gets confused and we trip over a !list_empty(&osd->o_linger_requests) assert in __remove_osd(). Reproducer, MON=1 OSD=1: # cat remove-osd.sh #!/bin/bash rbd create --size 1 test DEV=$(rbd map test) ceph osd out 0 sleep 3 rbd map bar/b # obtain a new osdmap as a side effect rbd unmap $DEV & # will block sleep 3 ceph osd in 0 Signed-off-by: Ilya Dryomov --- net/ceph/osd_client.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c index 5a75395fe0ff..ce09da2cf32b 100644 --- a/net/ceph/osd_client.c +++ b/net/ceph/osd_client.c @@ -1395,6 +1395,7 @@ static int __map_request(struct ceph_osd_client *osdc, if (req->r_osd) { __cancel_request(req); list_del_init(&req->r_osd_item); + list_del_init(&req->r_linger_osd_item); req->r_osd = NULL; }