Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp987771iob; Fri, 13 May 2022 18:42:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzLupsDCUA4k2oCkPrJamWP+PH8SVxOxeuMBbNxkwUQAjSGxmYSC/zml3Y6Wvi51QinaPha X-Received: by 2002:a5d:598f:0:b0:20c:83c9:b05b with SMTP id n15-20020a5d598f000000b0020c83c9b05bmr5958543wri.343.1652492577251; Fri, 13 May 2022 18:42:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652492577; cv=none; d=google.com; s=arc-20160816; b=YVOG0TemLYERO5Ca7cs7853RTJVsTDGB8RiFP02iKKme8gikwMhoVRIY80nUlVW4Tb oCyGyF2I4AOYIM9jqJCAWsoHjGPVxdJR+sQPItwwwD8b9ySHgNRo5mGbHhCpLWFGxIg2 ocBeFEpTyHGAph04k/jFLcJgsKMCFN8yszXP2OAojenWrRqfzvd7ZqjUd0/ZvOQH4+PQ c0XQjh+pL9DlgMXpbIUssfjhU5FViV84tqxXwgsKgldOKizuMt8FTTxVqcwm1ujco1O4 F5kiA4WOyIjkR+JHObDx9Kbo8TjY3bbX6vg1icX5VTUlkfdyQ/x9ykKAFbdwLLk38Hsx 4+3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=iywQtXelYTHo32D1tr1Is1mkpMiEf3de8gjUGnLQUz0=; b=M7+9WISmFMkWgksMM4YQL2i7bt1NZoZk7/lD9WeWz3DpTFXRkwLI5oYlKSCzvtIgEz ASB5dTkv3g/+F0WrUfW66OmA0CiisYVUM0o3IbZvCNOQ8YI/X+aoGvc+aKXcI5UnFd8q DFDhs1qDof7iS4+qjG14T+4hQjypEZmqjuXyRrv+bdV6MRVKANR62DG4N7oaSsMw1CJA NLJqE4Dfsi1HHZ8YNfvc63Eswymt0VjVtQxfjkRQPIWCVnD5VuMBnCvGEgEVDxM8Qf2/ IArUFUJ9ad6BM4BukIIFCMi8a4uqXJiVq7+urVKeIIzmJqw2EOjTgKE9iK6G7CKKwFi9 Vy4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=t0axkAn3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id v10-20020a056000144a00b0020a93c65d1csi3940381wrx.700.2022.05.13.18.42.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 18:42:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=t0axkAn3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4F07F42DC2F; Fri, 13 May 2022 17:08:51 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379335AbiEMKSl (ORCPT + 99 others); Fri, 13 May 2022 06:18:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379330AbiEMKSc (ORCPT ); Fri, 13 May 2022 06:18:32 -0400 Received: from alexa-out.qualcomm.com (alexa-out.qualcomm.com [129.46.98.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47B2B23150; Fri, 13 May 2022 03:18:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1652437111; x=1683973111; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=iywQtXelYTHo32D1tr1Is1mkpMiEf3de8gjUGnLQUz0=; b=t0axkAn3ZVa6uFP4hdCBjFR1lqsephLI0CAtzUDWdiJnrsCJuo2Aja46 ntHaVyxIioSMiTPSgDV1wjzVWi/nF7IObk8wuoVPtql8K5rYYucFHF82P APN1auImrgcgcaETkgy4jv80botnbAY0MHM2jIcqcerSWW9DaTp+QaKsa s=; Received: from ironmsg08-lv.qualcomm.com ([10.47.202.152]) by alexa-out.qualcomm.com with ESMTP; 13 May 2022 03:18:31 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg08-lv.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 May 2022 03:18:30 -0700 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Fri, 13 May 2022 03:18:29 -0700 Received: from [10.214.30.67] (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Fri, 13 May 2022 03:18:26 -0700 Message-ID: <2a45f1e1-39d5-76b3-8fd3-c1f8b288afac@quicinc.com> Date: Fri, 13 May 2022 15:48:23 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH V3] dma-buf: ensure unique directory name for dmabuf stats Content-Language: en-US To: Greg KH CC: , , , , , , , , References: <1652434689-6203-1-git-send-email-quic_charante@quicinc.com> From: Charan Teja Kalla In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/13/2022 3:41 PM, Greg KH wrote: >> Reported-by: kernel test robot > The trest robot did not say that the dmabuf stat name was being > duplicated, did it? > It reported a printk warning on V2[1]. Should we remove this on V3? @Christian: Could you please drop this tag while merging? [1] https://lore.kernel.org/all/202205110511.E0d8TXXC-lkp@intel.com/ >> diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c >> index a6fc96e..0ad5039 100644 >> --- a/drivers/dma-buf/dma-buf.c >> +++ b/drivers/dma-buf/dma-buf.c >> @@ -407,6 +407,7 @@ static inline int is_dma_buf_file(struct file *file) >> >> static struct file *dma_buf_getfile(struct dma_buf *dmabuf, int flags) >> { >> + static atomic64_t dmabuf_inode = ATOMIC64_INIT(0); >> struct file *file; >> struct inode *inode = alloc_anon_inode(dma_buf_mnt->mnt_sb); >> >> @@ -416,6 +417,13 @@ static struct file *dma_buf_getfile(struct dma_buf *dmabuf, int flags) >> inode->i_size = dmabuf->size; >> inode_set_bytes(inode, dmabuf->size); >> >> + /* >> + * The ->i_ino acquired from get_next_ino() is not unique thus >> + * not suitable for using it as dentry name by dmabuf stats. >> + * Override ->i_ino with the unique and dmabuffs specific >> + * value. >> + */ >> + inode->i_ino = atomic64_add_return(1, &dmabuf_inode); >> file = alloc_file_pseudo(inode, dma_buf_mnt, "dmabuf", >> flags, &dma_buf_fops); >> if (IS_ERR(file)) >> -- >> 2.7.4 >> > Reviewed-by: Greg Kroah-Hartman Thanks for the ACK. --Charan