Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp844380pxb; Thu, 15 Apr 2021 07:56:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxyzeoUYnXzdqroJwGT32rVXeF67xk7luZwTLMvh4+LLx7cikDi0EknQu/wf+kZJ7ysXSke X-Received: by 2002:a62:3642:0:b029:225:a79b:da18 with SMTP id d63-20020a6236420000b0290225a79bda18mr3348142pfa.75.1618498607083; Thu, 15 Apr 2021 07:56:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618498607; cv=none; d=google.com; s=arc-20160816; b=K465Bkm7MUFxMCy6R8RvmsXrujk25qKzIjC9yRS1eeFatmaEjIT/UPOR025zzKqMbd UyVEMo2BDrm/z3FsdIo8BxrL9GW2OwdBoZTvDHuBlYi5unQ0ZggRsCXuzWSpoWcgn1uG 1J8EuBO4J4Eytnxc7Dd8RcO/3QtwyTuBrKfQgE9N1LtwCAgISGfxvCOILUSqiiiAa+o0 7vX+28RQor/72X9sIsFIvyFrRGtruO+Wsj1UWN++ExWfVnKrQmJKHraecuxSz6bshD1q DBHzo/7Jyaf9rI5qDKbJ+4SQWMbtUzA9oqxwjSk1nVWxXEiMbrQPaLKqz5p0j0YkcFfM 4rcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=Yhv+oIi881Wgsc3Q1qGBC+RzhabNoWArSeuEYCDa/2E=; b=IscOgseGM7cNFwLaZiyWD/qf2bv5WMsJB0un4F92CwTu4rm1fRi6WNvlY0PbrXm/4n yvBETPwC7Re/BtsdwhlVzHtiN6JvpTELIvIIYEyhdhfXNvMO2JGVVgSxzunTvzVQwRrd aP8NQMBPiwlj5de2rj6Ms4aKtIxdSb/rQLTDpGL2Eg4HlXwMK7UvZiGzsUnqfXXncUKn 70nKyWfyKQ5NACm8PZHzu9zCKa4A3GCKqC38P+dJeHwvzadM1CuuYKWQddKJFCzJsDbE H79rGJV6Uj43fB1F5G3P2J7Z47DNzh0xSlUTX9lDoHMd3EfgoRqX1mO/oSDCMm0uVVN3 B+1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="EzArC/Zm"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r139si2646009pgr.169.2021.04.15.07.56.34; Thu, 15 Apr 2021 07:56:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="EzArC/Zm"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234401AbhDOOzr (ORCPT + 99 others); Thu, 15 Apr 2021 10:55:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234234AbhDOOwq (ORCPT ); Thu, 15 Apr 2021 10:52:46 -0400 Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 40B83C06138D; Thu, 15 Apr 2021 07:52:16 -0700 (PDT) Received: by mail-wm1-x32a.google.com with SMTP id o21-20020a1c4d150000b029012e52898006so2883374wmh.0; Thu, 15 Apr 2021 07:52:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:subject:from:to:cc:date:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=Yhv+oIi881Wgsc3Q1qGBC+RzhabNoWArSeuEYCDa/2E=; b=EzArC/Zm3EHVt1YR03UnvVaqbepPonzJGS4D7tcivNVIi4F+WUhaIeYG4lTwaok4kH MUGH+LBTxu7RRgzIOysyK6k8W8KJMNGDNe0zGjrfq/lSfUGuv/E4/9OxNsm9CdEVPpbf 6Z5bm9qn8G5iIhuajEwvl0r7aQw0p9SvZcK06s4rotVdqiN55OUKQ3fshrjxcpQCVkDy YsC1uNxY/dbWTTyBq9wj2LQqgH9BBGLR23yN5MHjvaJKkbQ7I71HmXZm9E3Fij4kDWzO hGoWAqNgcHaTUrKrOkNsre78E3a2SM1Cqhw/4Wf1OlkrhiPKM56/g9wg8WcgzBd54A6M zgWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=Yhv+oIi881Wgsc3Q1qGBC+RzhabNoWArSeuEYCDa/2E=; b=bWJR5Zvq1te8H+wF8liYrsgsK+79BScdpOa1dZ2uwc8biTGMw+Fx+gI43HRhWI3ySa +xIFxaP12QM6wM+Pb/fkNhlj9AfhQbzHUT8DOUKa0viiZmfKRkktoDUxKsdSn7UOb5cv pTyFB3mm1VoqKjhdcDwlrTKm4MPAUAfORxqpQPPi/o23Nb0HU76sJo1ZOKWcJW1S34LI IYPOtET6UtwpDrSBt2WdNUTMdEHSHIuRkc10iLWv/38paZv+dKqt/iZy++k73f7nllLu Dm+AH4+6EJEVw6Su7vk/1/+kNzO3Esj3YLA+QOznrAX7B/JWJ9cEi9FGisrOBUQnGCd1 UPqQ== X-Gm-Message-State: AOAM532QWly7YSuCWERpZwbs+1ch1DiNbcgdNzyLObiD+mik0UPZS9rI PkWB5yngWhJMkojrbmdc6h/0U/hk/6pApddd X-Received: by 2002:a1c:730e:: with SMTP id d14mr2847757wmb.20.1618498335024; Thu, 15 Apr 2021 07:52:15 -0700 (PDT) Received: from 192.168.10.5 ([39.46.65.172]) by smtp.gmail.com with ESMTPSA id 64sm3187015wmz.7.2021.04.15.07.52.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Apr 2021 07:52:14 -0700 (PDT) Message-ID: <654ae83eb92077ab01b962890fdf57453d889d7c.camel@gmail.com> Subject: Re: [PATCH] cifs: remove unnecessary copies of tcon->crfid.fid From: Muhammad Usama Anjum To: =?ISO-8859-1?Q?Aur=E9lien?= Aptel , Steve French , Ronnie Sahlberg , "open list:COMMON INTERNET FILE SYSTEM CLIENT (CIFS)" , "moderated list:COMMON INTERNET FILE SYSTEM CLIENT (CIFS)" , open list Cc: musamaanjum@gmail.com, kernel-janitors@vger.kernel.org, dan.carpenter@oracle.com, colin.king@canonical.com Date: Thu, 15 Apr 2021 19:52:09 +0500 In-Reply-To: <87tuo913g6.fsf@suse.com> References: <20210413232558.GA1136036@LEGION> <87tuo913g6.fsf@suse.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.4-0ubuntu1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2021-04-14 at 14:00 +0200, Aurélien Aptel wrote: > Muhammad Usama Anjum writes: > > pfid is being set to tcon->crfid.fid and they are copied in each other > > multiple times. Remove the memcopy between same pointers. > > > > Addresses-Coverity: ("Overlapped copy") > > Fixes: 9e81e8ff74b9 ("cifs: return cached_fid from open_shroot") > > Signed-off-by: Muhammad Usama Anjum > > --- > > I'm not sure why refcount was being incremented here. This file has been > > evoloved so much. Any ideas? > > The fact that pfid is the same as the cache is very weird... Probably > due to recent change. > > This function returns a cached dir entry for the root of the share which > can be accessed/shared by multiple task. > Aurélien Aptel, Thank you so much for awesome explanation. The whole function makes sense now. We need to remove the memcpy calls only. We need to increment the refcount (it was removed in this patch). I'll send a V2. Regards, Usama