From patchwork Mon Aug 13 17:25:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 10564541 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4539413BB for ; Mon, 13 Aug 2018 17:25:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1F871296BF for ; Mon, 13 Aug 2018 17:25:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 12AB7296C6; Mon, 13 Aug 2018 17:25:34 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,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 89CC5296BC for ; Mon, 13 Aug 2018 17:25:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729977AbeHMUIk (ORCPT ); Mon, 13 Aug 2018 16:08:40 -0400 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:12170 "EHLO esa1.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729029AbeHMUIk (ORCPT ); Mon, 13 Aug 2018 16:08:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1534181132; x=1565717132; h=from:to:cc:subject:date:message-id; bh=4IO6XTXCbPYSHrqHY1HrUvt/Ydc5iihs1xGP2OcN8cc=; b=Q9t0HK4LTOUAklzd2Db86Jgjz7f6vgbrArtMah44y6uZQWi8WiniBJNG kxMD5eWn9avbsxIr0eUhMErwhSkK/QYO5n5U0p+H2wL8zm+bGmh8IgXb3 YwhlwOF0H+8O9v38tr1gvL3A3b6bLg74cOpVrK3PuWLZwqeXMColds8Kr I2EfpmbMXJE2WtT/Gu2fQJ2d7aO0OC5BoOcn6qPdr8j1R3XXs4uqwMJXz W3pOG03m2ounyGuOhqaV61Kx2E0eHYbL/vJVgP5nuuZVbQSaOzfHAK0FH CArSXrKPjN1q9/TysW8I4RUZu7nlD1fuqUiFq9EJvrMLgBPU+pqvOLh7w g==; X-IronPort-AV: E=Sophos;i="5.53,234,1531756800"; d="scan'208";a="191415862" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 14 Aug 2018 01:25:32 +0800 Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP; 13 Aug 2018 10:13:34 -0700 Received: from thinkpad-bart.sdcorp.global.sandisk.com ([10.111.67.248]) by uls-op-cesaip01.wdc.com with ESMTP; 13 Aug 2018 10:25:32 -0700 From: Bart Van Assche To: Jens Axboe Cc: linux-block@vger.kernel.org, Christoph Hellwig , Greg Kroah-Hartman , Bart Van Assche Subject: [PATCH v2 0/2] Fix a race condition related to creation of /dev/nvme0n Date: Mon, 13 Aug 2018 10:25:29 -0700 Message-Id: <20180813172531.7451-1-bart.vanassche@wdc.com> X-Mailer: git-send-email 2.18.0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hello Jens, The two patches in this series fix a race condition related to the creation of the sysfs attributes for the /dev/nvme0n devices nodes. I encountered this race while adding tests to the blktests project for the NVMeOF kernel drivers. Please consider these patches for the upstream kernel. Thanks, Bart. Bart Van Assche (2): block: Introduce alloc_disk_node_attr() nvme: Fix race conditions related to creation of /dev/nvme0n block/genhd.c | 26 ++++++++++++++++++++++++-- drivers/nvme/host/core.c | 17 +++++------------ drivers/nvme/host/lightnvm.c | 34 +++++++--------------------------- drivers/nvme/host/nvme.h | 9 ++++----- include/linux/genhd.h | 13 +++++++++++-- 5 files changed, 51 insertions(+), 48 deletions(-)