Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1852797pxb; Wed, 10 Feb 2021 19:56:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJwqTF7iy0/C6rENhEK+mWm2h0XcpV7ikvGlVEfgg70fTd+PYSnsF9/4T7PcIzhz28x18Y7H X-Received: by 2002:a05:6402:278a:: with SMTP id b10mr6313904ede.347.1613015807546; Wed, 10 Feb 2021 19:56:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613015807; cv=none; d=google.com; s=arc-20160816; b=FGt/kG3kn/ycfEbz8SLzD+kGoSYex0EFKl79Na+NXxBz8kLL7UKTL93eKcG+T7Jc3n qu+Vsi477k5raxbc214wsa2mzXxGiRb03+EYbyxM3Ve838QT/DpSTImQz903jqnNdPcR Z5bF6XmMcHxwS09X1Mhler0xofLhpxkxEh9FI8sIHwH/wkSJIWM1Ge2kM/baLexbtFzn oCuGGQQS4H3O1wcUpkMQrhSQgWT7T3mG0mDuKieP/ezdfFP0x9+z6ne1faW74oqXG93u CfGUxFccC6mGpnHBX5ZMDgYGTlifJbfDKv9uojXbYnXz0OOVxXDRjc/hHEV+Ur1X9tZ1 8eDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=h6fXXEaBT2Z0LaFhdMl/3Ju7cfifap0FwglElJTy0ZU=; b=AepWuX1+jb4D3QXS5Ni3Rk0Nn2jqV84SWZzYEKrjyahmZDcicWvWBdLuKHXBhOWMTE ruTRgwl1JLOMOtX8ZK6Tw8HKrnex/f3agXOpaPStErjuUgTOg9tEyncmS/8n6oNKEyw3 z2wckuJ5Hyv1Fg5/Q9Pzlp+cC3UPgwnOYzO0/p4/G/f74+SWvE2QzN8IKlrg0yiMydku pT9hw5FQwO2hf1bnq4GjaYUAOovdCzEBWUuu8trRU+6raMgiyB7tJC/CEw6vmMus31Yq 1Uv1unq1xJ+tbrNWVXE6U9t3dqi9Fnm+/WnpuIIH5qojDEH6AO0sSL+xvT/AAkGc2pWk YOrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="pzvP5/Pf"; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ay23si2733984ejb.33.2021.02.10.19.56.24; Wed, 10 Feb 2021 19:56:47 -0800 (PST) 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=@kernel.org header.s=k20201202 header.b="pzvP5/Pf"; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229577AbhBKDqC (ORCPT + 99 others); Wed, 10 Feb 2021 22:46:02 -0500 Received: from mail.kernel.org ([198.145.29.99]:35924 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229452AbhBKDqB (ORCPT ); Wed, 10 Feb 2021 22:46:01 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2D934601FC; Thu, 11 Feb 2021 03:45:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1613015121; bh=iemugIdQeJU2GGS6+K1JMlL582bf/fRRHWUSkcs0xQE=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=pzvP5/Pf2KZUwiesMWWK1VNT/7zGrBUXMeNentd8JwpdYQL2Bdr3IMN6cVBAz5Sm6 dUC30JQAojoj57Jfxz0oorso/18dLWbVSIkVYMje0eM5gTjipLCVDbTV0AknH8W/xA pstGzFRpc94Ij5TLW6drIF0CEkcgy4Dyzg4lYCk0OpZP8Ej9nnMQMwIeAVC98xyakA uZMm9vYkNXsMu6Jgv+AyT9sj5j3IfTnzt+e9KAGLkGRhnBGUaQMyvj0+eLlBxPKIpm GntMSLfW8+oAVbZmorzS8uHVjCJoO3ftNJH5VxbcdS5tRCRJnRay4UGz+CmylcwOLl GB34gmgHudX2Q== Subject: Re: [PATCH] erofs: initialized fields can only be observed after bit is set To: Gao Xiang , linux-erofs@lists.ozlabs.org Cc: LKML , stable@vger.kernel.org References: <20210209130618.15838-1-hsiangkao.ref@aol.com> <20210209130618.15838-1-hsiangkao@aol.com> From: Chao Yu Message-ID: <801d8f5d-9d5f-bc6a-1796-70d1038611da@kernel.org> Date: Thu, 11 Feb 2021 11:45:20 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <20210209130618.15838-1-hsiangkao@aol.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021/2/9 21:06, Gao Xiang via Linux-erofs wrote: > From: Gao Xiang > > Currently, although set_bit() & test_bit() pairs are used as a fast- > path for initialized configurations. However, these atomic ops are > actually relaxed forms. Instead, load-acquire & store-release form is > needed to make sure uninitialized fields won't be observed in advance > here (yet no such corresponding bitops so use full barriers instead.) > > Fixes: 62dc45979f3f ("staging: erofs: fix race of initializing xattrs of a inode at the same time") > Fixes: 152a333a5895 ("staging: erofs: add compacted compression indexes support") > Cc: # 5.3+ > Reported-by: Huang Jianan > Signed-off-by: Gao Xiang Thanks for detailed explanation for barrier offline. Reviewed-by: Chao Yu Thanks,