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=-0.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS 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 97155FA372C for ; Fri, 8 Nov 2019 17:39:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 67E62206C3 for ; Fri, 8 Nov 2019 17:39:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573234757; bh=9+XypJzcXuWZ9IZHORgHVbOUGiNiPdtVfZoUTZCouOo=; h=References:In-Reply-To:From:Date:Subject:To:Cc:List-ID:From; b=IPWePBnLX9gsPkH7Vbu18SFegAmqX2RPx5YfaIEbGxQmSa6fQyhcI3/8mxcJKGwjN nUR4FjPfRQ2BCNlgk9BA7PC8xsL1A6+sAyyQMTUrwCUiYtI1jSEFYVoIJ0Fw1U7ZFP ByNohJIskSKJh09lYqVJ2cGu10s7oL1Q0hrO9u5c= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728370AbfKHRjQ (ORCPT ); Fri, 8 Nov 2019 12:39:16 -0500 Received: from mail-lj1-f193.google.com ([209.85.208.193]:39049 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726232AbfKHRjP (ORCPT ); Fri, 8 Nov 2019 12:39:15 -0500 Received: by mail-lj1-f193.google.com with SMTP id p18so7084362ljc.6 for ; Fri, 08 Nov 2019 09:39:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=X0HyUPs5wRItBK7m6Cq2qgQoPBnwk/wYZPQ6kr3orrA=; b=cNIrikGewcX3TfzGA7DTIDVQAsE0zbz7keQN8vCX7RCd/Hv905PLymolBEW+BYQraJ sWDYisbWpxTssmp2D2YezzJf3kW7bs+FdM4VtnlBu+i15ynPCQAQkhBEXHKASRmGjNQF u2eTspzbiv17j9VBNXqDv9laIVCLfAQXMtCS8= 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:cc; bh=X0HyUPs5wRItBK7m6Cq2qgQoPBnwk/wYZPQ6kr3orrA=; b=pQzuOZWnVPazD97lkcIyuiDcTFxxCHO2j8IF6dULVIMjeZFs3vwSTW0PY96Kb1OFaD 9+ZfznG1pxxTkra0aC5fkKwUz7veEouFbCo8sF8itwi1XZ0SFGd3XijYkN1k9rfn8im6 f8Ud+C21TkWq19Q4mTeHQ8ZXg+D+DpYRVjIGN4+Ts3WYYjtBeztBVAzcTdKKWIEpDsn7 QxEW6Rwof56tGh3J+zOr/OcYzqAdPjv/zcA4xXgBGxR0Hsy7kv+ktfFqWjHRUQOlhIUI Dc4o5VqwEC9CR7pKue0WFd6T+x7UAfVADHEsR5T6qiZlUXNLpVJ77OCxST3eZ4VNjxKB bxOg== X-Gm-Message-State: APjAAAWf1vcl2v6ppfB9p/WAhJbLsEm1r3tymgUkJrPc3lIDwLlw6rLv vj5E2ANeOUydG8KtjSbBljVtSfXEe3Q= X-Google-Smtp-Source: APXvYqyNUt18Klzsccvmi5zrtITt8wwc++3BKv6dxsqLczeRPEzMrN/MdO+88++H6lZqjaDP1f0hXg== X-Received: by 2002:a2e:a0ce:: with SMTP id f14mr7840749ljm.241.1573234752064; Fri, 08 Nov 2019 09:39:12 -0800 (PST) Received: from mail-lf1-f46.google.com (mail-lf1-f46.google.com. [209.85.167.46]) by smtp.gmail.com with ESMTPSA id m12sm2678496lfb.60.2019.11.08.09.39.10 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 08 Nov 2019 09:39:10 -0800 (PST) Received: by mail-lf1-f46.google.com with SMTP id z12so5058088lfj.9 for ; Fri, 08 Nov 2019 09:39:10 -0800 (PST) X-Received: by 2002:ac2:5587:: with SMTP id v7mr7485443lfg.79.1573234750371; Fri, 08 Nov 2019 09:39:10 -0800 (PST) MIME-Version: 1.0 References: <000000000000c422a80596d595ee@google.com> <6bddae34-93df-6820-0390-ac18dcbf0927@gmail.com> In-Reply-To: From: Linus Torvalds Date: Fri, 8 Nov 2019 09:38:54 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: KCSAN: data-race in __alloc_file / __alloc_file To: Eric Dumazet Cc: Eric Dumazet , syzbot , Marco Elver , linux-fsdevel , Linux Kernel Mailing List , syzkaller-bugs , Al Viro Content-Type: text/plain; charset="UTF-8" Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org Archived-At: List-Archive: List-Post: On Fri, Nov 8, 2019 at 9:22 AM Eric Dumazet wrote: > > Ok, so what do you suggest next ? > > Declare KCSAN useless because too many false positives ? I'd hope that there is some way to mark the cases we know about where we just have a flag. I'm not sure what KCSAN uses right now - is it just the "volatile" that makes KCSAN ignore it, or are there other ways to do it? "volatile" has huge problems with code generation for gcc. It would probably be fine for "not_rcu" in this case, but I'd like to avoid it in general otherwise, which is why I wonder if there are other options. But worst comes to worst, I'd be ok with a WRITE_ONCE() and a comment about why (and the reason being KCSAN, not the questionable optimization). Linus