Message ID | 20210414122402.203388-10-gi-oh.kim@ionos.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-block-owner@kernel.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0B07CC43460 for <linux-block@archiver.kernel.org>; Wed, 14 Apr 2021 12:24:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D6EC3610E8 for <linux-block@archiver.kernel.org>; Wed, 14 Apr 2021 12:24:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233367AbhDNMYk (ORCPT <rfc822;linux-block@archiver.kernel.org>); Wed, 14 Apr 2021 08:24:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34834 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233260AbhDNMYk (ORCPT <rfc822;linux-block@vger.kernel.org>); Wed, 14 Apr 2021 08:24:40 -0400 Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com [IPv6:2a00:1450:4864:20::52b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA960C061756 for <linux-block@vger.kernel.org>; Wed, 14 Apr 2021 05:24:18 -0700 (PDT) Received: by mail-ed1-x52b.google.com with SMTP id g17so22720692edm.6 for <linux-block@vger.kernel.org>; Wed, 14 Apr 2021 05:24:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ionos.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=FGH+Ljl4s6SmZtr/mbRqxMi5iJCFYf0z8DPotTgMP2c=; b=fmpAlPUPUx3Xyp4XRRqqV/oml+irzcKMcw/bCpXoUC3VZVgBmHOisKYIU7UiIHUwwb IISajsQSzQ6bx+8sIJUvCe3L59YVLhsnOLdNU9FXuqO/W8jwEhilzt+zS89bV9Koduk4 AXJaAB5zxyRzgdEnL77UC8issa6VskQXWUdd/0L76ANVqI4RVLuFJ10n5tECwIhntkxf qY3nb349lt5E5qx59yAIsx9f4+ueeV/vp+aGFZIf3lU11BHMSA9lOhlhYfhAXVnxghlI 03nZ96+J/bd6K82Co/tbAUeAesR+uS2OykuQRBHLslBQ/gjMsNbOLzpJHxJV9vwTuv6E xDbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=FGH+Ljl4s6SmZtr/mbRqxMi5iJCFYf0z8DPotTgMP2c=; b=sBCHm9yGhp63R3h0X28X1ZkSXROJ1YqBXs1SNB4XW3hIhjod1cNisPqd2Zgpm1W6sB fhDFKnvj1IQWnophrbi3YCW5YqK3BDpnCIlNALQky69GsXIE0RdAJ/NVHqLIzFlJI89b PNrn6Vjf4vNdfcWp1YoyMUrv4UcDUHq3rz5seRt3MRVXxUxxSzxrwMp1QGe4hEhId/ad oeGQR4arBjQcakb8zuZXbAe7u3rqHfIjh+EjYPv+l1mS/OVxkU13J7PKn7YM4SsA61Lf 5o12eKcaT42joevgdtK6NVcaCHRBaMVjHsKWpunSZtQ7albAeEi2f4b+fHzz+5C8Q838 RtCg== X-Gm-Message-State: AOAM533Qummtlll6K4ANziVMcbWq2ImGSHVEkVO5WBVJu9oX6Sc7Eisb f6lkb3BtaTeT6BdOX9/UBSbyT4ghn2SE0JD2 X-Google-Smtp-Source: ABdhPJypHyKnAEC+suzOLNJrYcVOMjPye+iXUKybYSS2t9jbQOz5em7N32diaBqZ6lBkPXah1n2xkw== X-Received: by 2002:aa7:d14f:: with SMTP id r15mr26521820edo.130.1618403057265; Wed, 14 Apr 2021 05:24:17 -0700 (PDT) Received: from gkim-laptop.fkb.profitbricks.net (ip5f5aeee5.dynamic.kabel-deutschland.de. [95.90.238.229]) by smtp.googlemail.com with ESMTPSA id y26sm6201306ejj.98.2021.04.14.05.24.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Apr 2021 05:24:16 -0700 (PDT) From: Gioh Kim <gi-oh.kim@ionos.com> To: linux-block@vger.kernel.org Cc: axboe@kernel.dk, hch@infradead.org, sagi@grimberg.me, bvanassche@acm.org, haris.iqbal@ionos.com, jinpu.wang@ionos.com, Gioh Kim <gi-oh.kim@cloud.ionos.com>, Gioh Kim <gi-oh.kim@ionos.com> Subject: [PATCHv4 for-next 09/19] block/rnbd-srv: Prevent a deadlock generated by accessing sysfs in parallel Date: Wed, 14 Apr 2021 14:23:52 +0200 Message-Id: <20210414122402.203388-10-gi-oh.kim@ionos.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210414122402.203388-1-gi-oh.kim@ionos.com> References: <20210414122402.203388-1-gi-oh.kim@ionos.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: <linux-block.vger.kernel.org> X-Mailing-List: linux-block@vger.kernel.org |
Series |
Misc update for rnbd
|
expand
|
diff --git a/drivers/block/rnbd/rnbd-srv.c b/drivers/block/rnbd/rnbd-srv.c index a4fd9f167c18..1549a6361630 100644 --- a/drivers/block/rnbd/rnbd-srv.c +++ b/drivers/block/rnbd/rnbd-srv.c @@ -334,7 +334,9 @@ void rnbd_srv_sess_dev_force_close(struct rnbd_srv_sess_dev *sess_dev) struct rnbd_srv_session *sess = sess_dev->sess; sess_dev->keep_id = true; - mutex_lock(&sess->lock); + /* It is already started to close by client's close message. */ + if (!mutex_trylock(&sess->lock)) + return; rnbd_srv_destroy_dev_session_sysfs(sess_dev); mutex_unlock(&sess->lock); }