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=-8.6 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_PASS,URIBL_BLOCKED,USER_IN_DEF_DKIM_WL autolearn=ham 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 9C166C43387 for ; Wed, 16 Jan 2019 09:48:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 64E9D206C2 for ; Wed, 16 Jan 2019 09:48:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="AL497Bi/" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391869AbfAPJsI (ORCPT ); Wed, 16 Jan 2019 04:48:08 -0500 Received: from mail-it1-f196.google.com ([209.85.166.196]:55365 "EHLO mail-it1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391867AbfAPJsI (ORCPT ); Wed, 16 Jan 2019 04:48:08 -0500 Received: by mail-it1-f196.google.com with SMTP id m62so2031457ith.5 for ; Wed, 16 Jan 2019 01:48:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=NNQwdzCXQt3s+FZSpfjOkNCFuvVzvVCEzWh35fQW6Qc=; b=AL497Bi/71/efPc0oh04axvbOukiY1L/PIP/uCmC9rTwhWrhqbiijCQuZVs4K7IoiQ NfsF2YF2oSm7WsRCyzBfnKsKaJeF26YgovonItnGV3iaoTptQr1AEYeFPRY4FzIbXSE7 6hkLkuzK0LPbjT07OtMBCyIwOl9cCbArOvfsO+Ku4gD6nkRrG5dBL5ryYJ8/vxb5p7we jBq0B8hJucc0VZkPuoOPF6UOE87gugjAiW+I2IMymm/rhc8HXCLsAsbd83J/EqrbjTJV Vxuc+wjsr1cfjQGWLfd7a7a04CfZU2KmFVq+94kiV4DHPI6nXVOZZrE+379Cfzz1rWi0 yI5A== 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=NNQwdzCXQt3s+FZSpfjOkNCFuvVzvVCEzWh35fQW6Qc=; b=itZIBRoqXcyL5MZB+vmnl422ObQR0c2WhKBQLfeD0PGlD22ihBl33kM8p/dUJj76IL ahJpf+h6OsYMLeZ7nC4amZ2Y2IDHDyFS+a8hApOKtjyVwQ2LZVCX5VqSita4c/nnOArQ TnoZiPol7Yq4CiGkirAmOR+tyj1MGih6LAn/vH8HedPbFvYb1x9Ad8jeA5KaNP3Bojb/ laEdcwyPXBRzUIaMLLEeL33kO+pcNDpozB3T2b6RCITRAuYOAvWDjABNUN6dW9YvAt8U +B+vZmtpm7Cldz8M8kpZJKhDkB0q2lyWNqyFQzQpRpCqxSON7LEdpMYVFXtBmNu2ZUMu rR5g== X-Gm-Message-State: AJcUukdiZB60dcSy7jU8z0X39spk0qs0A03oaSXOUVkLYkv4JlWqtwlU mDSatY/eSge5PhI1P/4jAR33/O1HkVlY+gWJiTzmhg== X-Google-Smtp-Source: ALg8bN5YH26FbkoRw3HKv8qlJZ5BgGVni54mOjyRGWq4hU7l5RGnJM76AwfJXMBUuKoG5xeReyOJ+k2YfbuteiE0gO8= X-Received: by 2002:a24:f14d:: with SMTP id q13mr935177iti.166.1547632087134; Wed, 16 Jan 2019 01:48:07 -0800 (PST) MIME-Version: 1.0 References: <1547201433-10231-1-git-send-email-penguin-kernel@I-love.SAKURA.ne.jp> <04c6d87c-fc26-b994-3b34-947414984abe@i-love.sakura.ne.jp> <54b68f21-c8b5-7074-74e0-06e3d7ee4003@i-love.sakura.ne.jp> In-Reply-To: <54b68f21-c8b5-7074-74e0-06e3d7ee4003@i-love.sakura.ne.jp> From: Dmitry Vyukov Date: Wed, 16 Jan 2019 10:47:56 +0100 Message-ID: Subject: Re: [PATCH] fs: ratelimit __find_get_block_slow() failure message. To: Tetsuo Handa Cc: Jan Kara , Al Viro , linux-fsdevel 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 On Fri, Jan 11, 2019 at 1:46 PM Tetsuo Handa wrote: > > On 2019/01/11 19:48, Dmitry Vyukov wrote: > >> How did you arrive to the conclusion that it is harmless? > >> There is only one relevant standard covering this, which is the C > >> language standard, and it is very clear on this -- this has Undefined > >> Behavior, that is the same as, for example, reading/writing random > >> pointers. > >> > >> Check out this on how any race that you might think is benign can be > >> badly miscompiled and lead to arbitrary program behavior: > >> https://software.intel.com/en-us/blogs/2013/01/06/benign-data-races-what-could-possibly-go-wrong > > > > Also there is no other practical definition of data race for automatic > > data race detectors than: two conflicting non-atomic concurrent > > accesses. Which this code is. Which means that if we continue writing > > such code we are not getting data race detection and don't detect > > thousands of races in kernel code that one may consider more harmful > > than this one the easy way. And instead will spent large amounts of > > time to fix some of then the hard way, and leave the rest as just too > > hard to debug so let the kernel continue crashing from time to time (I > > believe a portion of currently open syzbot bugs that developers just > > left as "I don't see how this can happen" are due to such races). > > > > I still cannot catch. Read/write of sizeof(long) bytes at naturally > aligned address is atomic, isn't it? Nobody guarantees this. According to C non-atomic conflicting reads/writes of sizeof(long) cause undefined behavior of the whole program. > I'm not using increments etc. > Therefore, in the worst case, some threads see outdated value. But > outdated values affect only time_in_range() test, which does not cause > severe problems like crash. >