Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5138325pxj; Tue, 22 Jun 2021 16:15:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwZUiB7YammC5QutKDhNFmtPPsCva1+L6H3NeDCTLMnWHc2SDtPMPHM57iQ0ZQALn0PE5Vr X-Received: by 2002:aa7:ccca:: with SMTP id y10mr8570528edt.258.1624403744680; Tue, 22 Jun 2021 16:15:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624403744; cv=none; d=google.com; s=arc-20160816; b=IeE50O50YWW7IJkWSOOgwL/g+2KWPzPMxIByEo+AKFS5XfLrBdxENvHqcR12v0hbcO xBIw5uh9Rq/3oPysGByOeLlorblwFX4bHbaAvSi5gHZ+1GU7AtAhoa4boiEWOBup1cy4 R5rCeC1e2lTnymBzTLI5ahQwv+JAJggfpreCmo4LY3qFsELxFoR9jJpqWOSQRHm8zn7y 3Oq/bnmOK8h5HzjdhLLYWNdH0VFgmCr8TA/dF4agu1+OQXezFM+nRufVOLeb7tBYb0lV a2xR9NpIEdau7w399IBjDpyLhKMzB+j/hNg/9PvrClm1fC47+lNLvCKiOjppvzlPnPgm 06qw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=gmTKbbw2VfNilxgf1MZbHcRGG9kAzGHmXVIKe38TtIg=; b=Ek2m53BLQXmO3ju/dxPduYUEeqqadICKS0zTCxnsX922UDH4d0jHWenWw24basNYr8 7ZlVmObxiJ8tFWc1uc1+aZAM/GkDProaqn2P6SMpzS2O1Xxlkns19QGhO0yntNof6xXs FDo0iCWMwEV5TORoKwF6feQnxI6KMwRIDv4OU4+a46HKU6MaFx63YpUBRklE7dsYfOVw Hl0IdTnQI9fI9C441vuUeOBTURS1XrYHCEhaE2iWV+BK5eU0BWhkH1VwVj68loO+Gaum m11qhSBXUGuc5w5Xetq7lSirfeusXUkkgN29TqB5Km9cc7jqlhz7vVr1twHTKMX/f70v w+GQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=dKy9U8Pr; 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 ia4si15626534ejc.84.2021.06.22.16.15.22; Tue, 22 Jun 2021 16:15:44 -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=dKy9U8Pr; 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 S229746AbhFVXQi (ORCPT + 99 others); Tue, 22 Jun 2021 19:16:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52400 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229501AbhFVXQi (ORCPT ); Tue, 22 Jun 2021 19:16:38 -0400 Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B203DC061574; Tue, 22 Jun 2021 16:14:20 -0700 (PDT) Received: by mail-lf1-x133.google.com with SMTP id i13so943030lfc.7; Tue, 22 Jun 2021 16:14:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=gmTKbbw2VfNilxgf1MZbHcRGG9kAzGHmXVIKe38TtIg=; b=dKy9U8PrSUScVJMENfpNd/50GsD7Jy+ap/wI/QIrOrFzxhsOHTrEZ024MS3zM7gNcI Ym3nW6eAfoYkoEeen9ElGsv/SD5qVg6J1IXcFVT1bP3NTF8pP7X6Avz9Ir4BMFRsV3VD mf8Lt+2TYKJ8iuTXSuUhQkwdoFTrROqtiQVouSx2C/HgPyZM/t4UuXBzZWQ+La9UGDOZ 7d9zfJmjzdFlammOsdBFE77gMO3GF1tsb1e2qqfXMEM3pZlJAXDk/xd3wnWEuepF318I 4Y2rb1/FRSmRvEyQPXHKmalSE7Hv4hJUVP4ks5Fh290eE+BPO0aBVd4tEF/RLr8SRN0p OLQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=gmTKbbw2VfNilxgf1MZbHcRGG9kAzGHmXVIKe38TtIg=; b=b/v5TkmKxSZuOJgRDajcHPi7PT6Qgh1HO6LrZcKg8YB1VX/nG39tsMvnfb9iygNIJg 7QrmAMhcx+d+bBSvpURaCBMNiCF7k5dczRBxxasdJHu/qjGC9H4dZ4bMNU/8GNU5nOJY fezmzQoMSisym2cwX/DjgHOeGaJwSTmtsCTQstLXmfUaSsyKozIxtAnwf4gYYcMCLDVe eOhRvj1fAEX7jfNqtFbOOvplCVIMVL3Y14ktn02AfQIqGjVpcUqNc3j5L3rqZHskFuoQ 0J64r+OhUP/5w4GH2WDu6Jl15/R3uvn+mhIyDHpmxzvbL9k/HTxcDfYKqdQL2PMKp738 KAiA== X-Gm-Message-State: AOAM533VLpBBfttBjxxjMCmfip0xIW+qJv3SR+r5JrljAfdQHADXYQxl s3lT30F82A6nQ+o5KRmpsgHnUU03WPwvPH8wFh19Z570yVM= X-Received: by 2002:a19:c190:: with SMTP id r138mr4688267lff.175.1624403658698; Tue, 22 Jun 2021 16:14:18 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Steve French Date: Tue, 22 Jun 2021 18:14:07 -0500 Message-ID: Subject: Re: coverity problems with certain macros To: CIFS , LKML Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Also interesting that it appears to show up only in the "linux" coverity report not the "linux-next" coverity report which have similar code there. On Tue, Jun 22, 2021 at 6:11 PM Steve French wrote: > > Looks like coverity's scan of the Linux kernel has problems with > analyzing locks across some debug print macros (which ironically don't > use any locks related to this component) > > e.g. Coverity Linux issues: 1484748, 1484736, 1475751, 1475743 and 1475726 > > as an example it flags the section of code below, and others with > calls to "cifs_dbf(VFS, ...) " in them (and note that the debug macros > don't take a lock) starting with the cifs_dbg(VFS, ...) call. It > says: > > "May result in deadlock if there is another attempt to acquire the lock. > In find_cifs_entry: Missing a release of a lock on a path" > > Oddly it doesn't flag "cifs_dbg(FYI, ...") calls, and even more > strangely the calls they flag are simply wrappers around calls to > "pr_err__ ## ratefunc ..." > > See below snippet from fs/cifs/readdir.c e.g. > > cifs_dbg(VFS, "reached end of buf searching > for pos in buf %d index to find %lld rc %d\n", > pos_in_buf, index_to_find, rc); > } > rc = 0; > *current_entry = cur_ent; > } else { > cifs_dbg(FYI, "index not in buffer - could not > findnext into it\n"); > return 0; > } > > if (pos_in_buf >= cfile->srch_inf.entries_in_buffer) { > cifs_dbg(FYI, "can not return entries pos_in_buf > beyond last\n"); > *num_to_ret = 0; > } else > *num_to_ret = cfile->srch_inf.entries_in_buffer - pos_in_buf; > > return rc; > } > > -- > Thanks, > > Steve -- Thanks, Steve