From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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=-6.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no 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 3AD26C4338F for ; Thu, 5 Aug 2021 18:16:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1220361004 for ; Thu, 5 Aug 2021 18:16:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235319AbhHESQf (ORCPT ); Thu, 5 Aug 2021 14:16:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:45564 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233076AbhHESQf (ORCPT ); Thu, 5 Aug 2021 14:16:35 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 430E460E8D; Thu, 5 Aug 2021 18:16:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1628187380; bh=fRMwCzEryajqu2xcp0mEV1Y2KxW3CpaQzsE/wiiybfE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=1z8mJt/GTpAKS88ThuPPyGJyJBQupScZMqntaDa9Igf0v2pzgnXML0W6mYw4oyqtX jlx1lVmUjC4FWjO9yUdDy2ND6Hbl88qvFmLaPEkTFcxlYQHG9WI6PHvpTPqyerqXpT 28wdqke0BajafjDpnLSssqqbelxZS0QiD7YVN6C8= Date: Thu, 5 Aug 2021 20:16:18 +0200 From: Greg Kroah-Hartman To: Long Li Cc: "longli@linuxonhyperv.com" , "linux-block@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-hyperv@vger.kernel.org" , Jonathan Corbet , KY Srinivasan , Haiyang Zhang , Stephen Hemminger , Wei Liu , Dexuan Cui , Bjorn Andersson , Hans de Goede , "Williams, Dan J" , Maximilian Luz , Mike Rapoport , Ben Widawsky , Jiri Slaby , Andra Paraschiv , Siddharth Gupta , Hannes Reinecke , "linux-doc@vger.kernel.org" Subject: Re: [Patch v5 2/3] Drivers: hv: add Azure Blob driver Message-ID: References: <1628146812-29798-1-git-send-email-longli@linuxonhyperv.com> <1628146812-29798-3-git-send-email-longli@linuxonhyperv.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-hyperv@vger.kernel.org On Thu, Aug 05, 2021 at 06:07:31PM +0000, Long Li wrote: > > Subject: Re: [Patch v5 2/3] Drivers: hv: add Azure Blob driver > > > > On Thu, Aug 05, 2021 at 12:00:11AM -0700, longli@linuxonhyperv.com wrote: > > > +static int az_blob_create_device(struct az_blob_device *dev) { > > > + int ret; > > > + struct dentry *debugfs_root; > > > + > > > + dev->misc.minor = MISC_DYNAMIC_MINOR, > > > + dev->misc.name = "azure_blob", > > > + dev->misc.fops = &az_blob_client_fops, > > > + > > > + ret = misc_register(&dev->misc); > > > + if (ret) > > > + return ret; > > > + > > > + debugfs_root = debugfs_create_dir("az_blob", NULL); > > > > So you try to create a directory in the root of debugfs called "az_blob" > > for every device in the system of this one type? > > > > That will blow up when you have multiple devices of the same type, please > > fix. > > The Hyper-V presents one such device for the whole VM. Today, maybe, tomorrow, who knows. Do not write code that we know will be wrong if you have multiple devices in the system of the same type. It takes almost no effort to get this correct. > I'm sorry I may have misunderstood. Are you suggesting I should create > a directory "hyperv" in the root of debugfs and put all the Hyper-V > driver debug information there? Ideally, yes, if the hyperv subsystem uses debugfs, it should make a subdir and you should use that. If not, then do whatever you want, but do not do something that you know will be broken if you have multiple devices of the same type in the system, like the current code is showing. thanks, greg k-h